use zerocopy::{FromBytes, Immutable, IntoBytes, KnownLayout, big_endian};
#[derive(
Debug,
Clone,
Copy,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash,
FromBytes,
IntoBytes,
Immutable,
KnownLayout,
)]
#[repr(C)]
pub struct MemoryReservation {
address: big_endian::U64,
size: big_endian::U64,
}
impl MemoryReservation {
pub(crate) const TERMINATOR: Self = Self::new(0, 0);
#[must_use]
pub const fn new(address: u64, size: u64) -> Self {
Self {
address: big_endian::U64::new(address),
size: big_endian::U64::new(size),
}
}
#[must_use]
pub const fn address(&self) -> u64 {
self.address.get()
}
#[must_use]
pub const fn size(&self) -> u64 {
self.size.get()
}
}