Skip to content

Commit

Permalink
feat: update zerocopy to 0.8 and endian-num to 0.2
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
  • Loading branch information
mkroening committed Oct 13, 2024
1 parent 0ad695f commit ff1aaf5
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 27 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.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ rustdoc-args = ["--cfg", "docsrs"]
allocator-api2 = { version = "0.2", default-features = false, features = ["alloc"], optional = true }
bitfield-struct = "0.9"
bitflags = "2"
endian-num = { version = "0.1", features = ["bitflags", "linux-types"] }
endian-num = { version = "0.2", features = ["bitflags", "linux-types"] }
num_enum = { version = "0.7", default-features = false }
pci_types = { version = "0.10", optional = true }
volatile = "0.6"
volatile-macro = "0.6"
zerocopy = { version = "0.7", optional = true, default-features = false }
zerocopy-derive = { version = "0.7", optional = true }
zerocopy = { version = "0.8", optional = true, default-features = false }
zerocopy-derive = { version = "0.8", optional = true }

[features]
alloc = ["dep:allocator-api2"]
Expand Down
5 changes: 3 additions & 2 deletions src/bitflags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ macro_rules! _bitflags_base {
#[cfg_attr(
feature = "zerocopy",
derive(
zerocopy_derive::FromZeroes,
zerocopy_derive::KnownLayout,
zerocopy_derive::Immutable,
zerocopy_derive::FromBytes,
zerocopy_derive::AsBytes
zerocopy_derive::IntoBytes,
)
)]
#[derive(Default, Clone, Copy, PartialEq, Eq, Hash)]
Expand Down
6 changes: 5 additions & 1 deletion src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ use super::le32;
#[doc(alias = "virtio_fs_config")]
#[cfg_attr(
feature = "zerocopy",
derive(zerocopy_derive::FromZeroes, zerocopy_derive::FromBytes)
derive(
zerocopy_derive::KnownLayout,
zerocopy_derive::Immutable,
zerocopy_derive::FromBytes,
)
)]
#[derive(VolatileFieldAccess)]
#[repr(C)]
Expand Down
16 changes: 11 additions & 5 deletions src/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ endian_bitflags! {
#[doc(alias = "virtio_net_config")]
#[cfg_attr(
feature = "zerocopy",
derive(zerocopy_derive::FromZeroes, zerocopy_derive::FromBytes)
derive(
zerocopy_derive::KnownLayout,
zerocopy_derive::Immutable,
zerocopy_derive::FromBytes,
)
)]
#[derive(VolatileFieldAccess)]
#[repr(C)]
Expand Down Expand Up @@ -102,9 +106,10 @@ virtio_bitflags! {
#[cfg_attr(
feature = "zerocopy",
derive(
zerocopy_derive::FromZeroes,
zerocopy_derive::KnownLayout,
zerocopy_derive::Immutable,
zerocopy_derive::FromBytes,
zerocopy_derive::AsBytes
zerocopy_derive::IntoBytes,
)
)]
#[derive(Default, Clone, Copy, Debug)]
Expand All @@ -126,9 +131,10 @@ pub struct Hdr {
#[cfg_attr(
feature = "zerocopy",
derive(
zerocopy_derive::FromZeroes,
zerocopy_derive::KnownLayout,
zerocopy_derive::Immutable,
zerocopy_derive::FromBytes,
zerocopy_derive::AsBytes
zerocopy_derive::IntoBytes,
)
)]
#[derive(Default, Clone, Copy, Debug)]
Expand Down
30 changes: 25 additions & 5 deletions src/pci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ use crate::{le16, le32, le64, DeviceConfigSpace, DeviceStatus, Le};
#[doc(alias = "virtio_pci_cap")]
#[cfg_attr(
feature = "zerocopy",
derive(zerocopy_derive::FromZeroes, zerocopy_derive::FromBytes)
derive(
zerocopy_derive::KnownLayout,
zerocopy_derive::Immutable,
zerocopy_derive::FromBytes,
)
)]
#[derive(Clone, Copy, Debug)]
#[repr(C)]
Expand Down Expand Up @@ -142,7 +146,11 @@ impl Cap {
#[doc(alias = "virtio_pci_cap64")]
#[cfg_attr(
feature = "zerocopy",
derive(zerocopy_derive::FromZeroes, zerocopy_derive::FromBytes)
derive(
zerocopy_derive::KnownLayout,
zerocopy_derive::Immutable,
zerocopy_derive::FromBytes,
)
)]
#[derive(Clone, Copy, Debug)]
#[repr(C)]
Expand All @@ -156,7 +164,11 @@ pub struct Cap64 {
#[doc(alias = "virtio_pci_notify_cap")]
#[cfg_attr(
feature = "zerocopy",
derive(zerocopy_derive::FromZeroes, zerocopy_derive::FromBytes)
derive(
zerocopy_derive::KnownLayout,
zerocopy_derive::Immutable,
zerocopy_derive::FromBytes,
)
)]
#[derive(Clone, Copy, Debug)]
#[repr(C)]
Expand All @@ -171,7 +183,11 @@ pub struct NotifyCap {
#[doc(alias = "virtio_pci_cfg_cap")]
#[cfg_attr(
feature = "zerocopy",
derive(zerocopy_derive::FromZeroes, zerocopy_derive::FromBytes)
derive(
zerocopy_derive::KnownLayout,
zerocopy_derive::Immutable,
zerocopy_derive::FromBytes,
)
)]
#[derive(Clone, Copy, Debug)]
#[repr(C)]
Expand Down Expand Up @@ -302,7 +318,11 @@ pub enum CapCfgType {
#[doc(alias = "virtio_pci_common_cfg")]
#[cfg_attr(
feature = "zerocopy",
derive(zerocopy_derive::FromZeroes, zerocopy_derive::FromBytes)
derive(
zerocopy_derive::KnownLayout,
zerocopy_derive::Immutable,
zerocopy_derive::FromBytes,
)
)]
#[derive(VolatileFieldAccess)]
#[repr(C)]
Expand Down
16 changes: 11 additions & 5 deletions src/vsock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ use crate::le64;
#[doc(alias = "virtio_vsock_config")]
#[cfg_attr(
feature = "zerocopy",
derive(zerocopy_derive::FromZeroes, zerocopy_derive::FromBytes)
derive(
zerocopy_derive::KnownLayout,
zerocopy_derive::Immutable,
zerocopy_derive::FromBytes,
)
)]
#[derive(VolatileFieldAccess)]
#[repr(C)]
Expand All @@ -26,9 +30,10 @@ pub struct Config {
#[cfg_attr(
feature = "zerocopy",
derive(
zerocopy_derive::FromZeroes,
zerocopy_derive::KnownLayout,
zerocopy_derive::Immutable,
zerocopy_derive::FromBytes,
zerocopy_derive::AsBytes
zerocopy_derive::IntoBytes,
)
)]
#[derive(Default, Clone, Copy, Debug)]
Expand Down Expand Up @@ -132,9 +137,10 @@ pub enum EventId {
#[cfg_attr(
feature = "zerocopy",
derive(
zerocopy_derive::FromZeroes,
zerocopy_derive::KnownLayout,
zerocopy_derive::Immutable,
zerocopy_derive::FromBytes,
zerocopy_derive::AsBytes
zerocopy_derive::IntoBytes,
)
)]
#[derive(Default, Clone, Copy, Debug)]
Expand Down

0 comments on commit ff1aaf5

Please sign in to comment.