|
|
@ -14,6 +14,21 @@ impl Entry {
|
|
|
|
pub fn flags(&self) -> EntryFlags {
|
|
|
|
pub fn flags(&self) -> EntryFlags {
|
|
|
|
EntryFlags::from_bits_truncate(self.0)
|
|
|
|
EntryFlags::from_bits_truncate(self.0)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn pointed_frame(&self) -> Option<Frame> {
|
|
|
|
|
|
|
|
if self.flags().contains(PRESENT) {
|
|
|
|
|
|
|
|
Some(Frame::containing_address(
|
|
|
|
|
|
|
|
self.0 as usize & 0x000fffff_fffff000
|
|
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
None
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn set(&mut self, frame: Frame, flags: EntryFlags) {
|
|
|
|
|
|
|
|
assert!(frame.start_address() & !0x000fffff_fffff000 == 0);
|
|
|
|
|
|
|
|
self.0 = (frame.start_address() as u64) | flags.bits();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bitflags! {
|
|
|
|
bitflags! {
|
|
|
|