Skip to content

Commit

Permalink
removed all unsafe for bindings
Browse files Browse the repository at this point in the history
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
  • Loading branch information
fujita committed Oct 23, 2022
1 parent 2b88260 commit 5dd7b1b
Show file tree
Hide file tree
Showing 2 changed files with 349 additions and 421 deletions.
6 changes: 6 additions & 0 deletions e1000_defs.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(dead_code)]

// FIXME: handle endian
#[repr(C)]
#[derive(Clone, Copy)]
Expand All @@ -8,6 +10,7 @@ pub(crate) struct DescFlags {
}

#[repr(C)]
#[derive(Clone, Copy)]
pub(crate) union TxLower {
pub(crate) data: u32,
pub(crate) flags: DescFlags,
Expand All @@ -22,19 +25,22 @@ pub(crate) struct DescFields {
}

#[repr(C)]
#[derive(Clone, Copy)]
pub(crate) union TxUpper {
pub(crate) data: u32,
pub(crate) fields: DescFields,
}

#[repr(C)]
#[derive(Clone, Copy)]
pub(crate) struct TxDesc {
pub(crate) buffer_addr: u64,
pub(crate) lower: TxLower,
pub(crate) upper: TxUpper,
}

#[repr(C)]
#[derive(Clone, Copy, Default)]
pub(crate) struct RxDesc {
pub(crate) buffer_addr: u64, /* Address of the descriptor's data buffer */
pub(crate) length: u16, /* Length of data DMAed into data buffer */
Expand Down

0 comments on commit 5dd7b1b

Please sign in to comment.