Skip to content

Commit

Permalink
assertions: replace with static_assertions
Browse files Browse the repository at this point in the history
crosvm has dropped the assertions crate in favor of the more commonly
used static_assertions crate. This change does the same for salus.
This breaks the only local dep in sbi which will allow that crate to be
pulled out and re-used more easily.

Signed-off-by: Dylan Reid <dgreid@rivosinc.com>
  • Loading branch information
dgreid authored and abrestic-rivos committed Jan 3, 2023
1 parent d9e21fc commit 7e74e3f
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 99 deletions.
12 changes: 4 additions & 8 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 @@ -12,7 +12,7 @@ panic = "abort"

[dependencies]
arrayvec = { version = "0.7.2", default-features = false }
assertions = { path = "./assertions" }
static_assertions = "1.1"
attestation = { path = "./attestation" }
const-oid = { version = "0.9.0", features = ["db"] }
data_model = { path = "./data-model" }
Expand Down
5 changes: 0 additions & 5 deletions assertions/Cargo.toml

This file was deleted.

43 changes: 0 additions & 43 deletions assertions/src/lib.rs

This file was deleted.

34 changes: 0 additions & 34 deletions assertions/src/mechanism.rs

This file was deleted.

2 changes: 1 addition & 1 deletion data-model/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ authors = ["The Chromium OS Authors"]
edition = "2021"

[dependencies]
assertions = { path = "../assertions" }
static_assertions = "1.1"
2 changes: 1 addition & 1 deletion data-model/src/endian.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
use core::mem::{align_of, size_of};

use assertions::const_assert;
use static_assertions::const_assert;

use crate::DataInit;

Expand Down
2 changes: 1 addition & 1 deletion drivers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ edition = "2021"

[dependencies]
arrayvec = { version = "0.7.2", default-features = false }
assertions = { path = "../assertions" }
const-field-offset = { version = "0.1.2" }
data_model = { path = "../data-model" }
device_tree = { path = "../device-tree" }
Expand All @@ -19,6 +18,7 @@ riscv_page_tables = { path = "../riscv-page-tables" }
riscv_pages = { path = "../riscv-pages" }
riscv_regs = { path = "../riscv-regs" }
spin = { version = "*", default-features = false, features = ["once"] }
static_assertions = "1.1"
tock-registers = { version = "0.7" }
sbi = { path = "../sbi" }
s_mode_utils = { path = "../s-mode-utils" }
Expand Down
2 changes: 1 addition & 1 deletion drivers/src/iommu/device_directory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

use assertions::const_assert;
use core::marker::PhantomData;
use riscv_page_tables::{GuestStagePageTable, GuestStagePagingMode};
use riscv_pages::*;
use riscv_regs::dma_wmb;
use spin::Mutex;
use static_assertions::const_assert;

use super::error::*;
use super::msi_page_table::MsiPageTable;
Expand Down
2 changes: 1 addition & 1 deletion drivers/src/iommu/registers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

use assertions::const_assert;
use static_assertions::const_assert;
use tock_registers::register_bitfields;
use tock_registers::registers::{ReadOnly, ReadWrite};

Expand Down
2 changes: 1 addition & 1 deletion drivers/src/pci/registers.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 assertions::const_assert;
use const_field_offset::FieldOffsets;
use static_assertions::const_assert;
use tock_registers::interfaces::Readable;
use tock_registers::registers::{ReadOnly, ReadWrite};
use tock_registers::{register_bitfields, LocalRegisterCopy, RegisterLongName, UIntLike};
Expand Down
2 changes: 1 addition & 1 deletion sbi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"

[dependencies]
arrayvec = { version = "0.7.2", default-features = false }
assertions = { path = "../assertions" }
static_assertions = "1.1"
flagset = "0.4.3"

[lib]
Expand Down
2 changes: 1 addition & 1 deletion sbi/src/api/tee_host.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 assertions::const_assert;
use core::{marker::PhantomData, ptr};
use static_assertions::const_assert;

use crate::TeeHostFunction::*;
use crate::{ecall_send, Error, Result, SbiMessage};
Expand Down

0 comments on commit 7e74e3f

Please sign in to comment.