Skip to content

Commit

Permalink
sbi: Switch to use submodule
Browse files Browse the repository at this point in the history
Use the new submodule imported copy of the sbi crate.

Add a rule to the makefile that initializes the submodule and make the
targets that use sbi depend on it to make things as easy as possible.

Signed-off-by: Dylan Reid <[email protected]>
  • Loading branch information
dgreid committed Jan 6, 2023
1 parent b227a33 commit 54e0a5e
Show file tree
Hide file tree
Showing 45 changed files with 84 additions and 4,529 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ riscv_pages = { path = "./riscv-pages" }
riscv_regs = { path = "./riscv-regs" }
s_mode_utils = { path = "./s-mode-utils" }
u_mode_api = { path = "./u-mode-api" }
sbi = { path = "./sbi" }
sbi_rs = { path = "./sbi-rs" }
spin = { version = "*", default-features = false }
sha2 = {version = "0.10", default-features = false }
riscv_elf = { path = "./riscv-elf" }
Expand Down
2 changes: 1 addition & 1 deletion attestation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ hex = { version = "0.4.3", default-features = false }
hkdf = "0.12.3"
hmac = "0.12.1"
rice = { git = "https://github.com/rivosinc/rice" }
sbi = { path = "../sbi" }
sbi_rs = { path = "../sbi-rs" }
spin = { version = "*", default-features = false, features = ["rwlock"] }
spki = "0.6.0"
typenum = "1.15.0"
2 changes: 1 addition & 1 deletion attestation/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use rice::{
layer::Layer,
x509::{certificate::MAX_CERT_SIZE, extensions::dice::tcbinfo::DiceTcbInfo, request::CertReq},
};
use sbi::{AttestationCapabilities, EvidenceFormat, HashAlgorithm};
use sbi_rs::{AttestationCapabilities, EvidenceFormat, HashAlgorithm};
use spin::RwLock;
use typenum::{Unsigned, U32};

Expand Down
2 changes: 1 addition & 1 deletion attestation/src/measurement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use const_oid::ObjectIdentifier;
use digest::{Digest, OutputSizeUser};
use generic_array::GenericArray;
use sbi::MeasurementRegisterDescriptor;
use sbi_rs::MeasurementRegisterDescriptor;

use crate::{Error, Result, TcgPcrIndex};

Expand Down
2 changes: 1 addition & 1 deletion drivers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ riscv_regs = { path = "../riscv-regs" }
spin = { version = "*", default-features = false, features = ["once"] }
static_assertions = "1.1"
tock-registers = { version = "0.7" }
sbi = { path = "../sbi" }
sbi_rs = { path = "../sbi-rs" }
s_mode_utils = { path = "../s-mode-utils" }

4 changes: 3 additions & 1 deletion drivers/src/pmu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
use core::ops::ControlFlow;

use arrayvec::ArrayVec;
use sbi::{api::pmu, Error as SbiError, PmuCounterInfo, PmuCounterStopFlags, Result as SbiResult};
use sbi_rs::{
api::pmu, Error as SbiError, PmuCounterInfo, PmuCounterStopFlags, Result as SbiResult,
};
use spin::Once;

/// Maximum number of supported platform PMU counters
Expand Down
2 changes: 1 addition & 1 deletion s-mode-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ version = "0.1.0"
edition = "2021"

[dependencies]
sbi = { path = "../sbi" }
sbi_rs = { path = "../sbi-rs" }
spin = { version = "*", default-features = false }
4 changes: 2 additions & 2 deletions s-mode-utils/src/ecall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

use sbi::Result as SbiResult;
use sbi::SbiMessage;
use sbi_rs::Result as SbiResult;
use sbi_rs::SbiMessage;

#[cfg(all(target_arch = "riscv64", target_os = "none"))]
use core::arch::asm;
Expand Down
4 changes: 2 additions & 2 deletions s-mode-utils/src/sbi_console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

use sbi::api::debug_console::console_puts;
use sbi::SbiMessage;
use sbi_rs::api::debug_console::console_puts;
use sbi_rs::SbiMessage;
use spin::{Mutex, Once};

use crate::ecall::ecall_send;
Expand Down
14 changes: 0 additions & 14 deletions sbi/Cargo.toml

This file was deleted.

17 changes: 0 additions & 17 deletions sbi/README.md

This file was deleted.

124 changes: 0 additions & 124 deletions sbi/src/api/attestation.rs

This file was deleted.

61 changes: 0 additions & 61 deletions sbi/src/api/base.rs

This file was deleted.

18 changes: 0 additions & 18 deletions sbi/src/api/debug_console.rs

This file was deleted.

Loading

0 comments on commit 54e0a5e

Please sign in to comment.