#[repr(transparent)]pub struct Pde2M(u64);Expand description
L2 PDE (2 MiB leaf) — maps a single 2 MiB page (PS = 1).
- PAT (Page Attribute Table) selector lives at bit 12 in this form.
 - Physical address uses bits 51:21 and must be 2 MiB aligned.
 Dirtyis set by CPU on first write;Globalkeeps TLB entries across CR3 reload unless explicitly invalidated.
This is a terminal mapping (leaf).
Tuple Fields§
§0: u64Implementations§
Source§impl Pde2M
 
impl Pde2M
const PRESENT_BITS: usize = 1usize
const PRESENT_OFFSET: usize = 0usize
const WRITABLE_BITS: usize = 1usize
const WRITABLE_OFFSET: usize = 1usize
const USER_BITS: usize = 1usize
const USER_OFFSET: usize = 2usize
const WRITE_THROUGH_BITS: usize = 1usize
const WRITE_THROUGH_OFFSET: usize = 3usize
const CACHE_DISABLE_BITS: usize = 1usize
const CACHE_DISABLE_OFFSET: usize = 4usize
const ACCESSED_BITS: usize = 1usize
const ACCESSED_OFFSET: usize = 5usize
const DIRTY_BITS: usize = 1usize
const DIRTY_OFFSET: usize = 6usize
const PAGE_SIZE_BITS: usize = 1usize
const PAGE_SIZE_OFFSET: usize = 7usize
const GLOBAL_BITS: usize = 1usize
const GLOBAL_OFFSET: usize = 8usize
const OS_AVAILABLE_LOW_BITS: usize = 3usize
const OS_AVAILABLE_LOW_OFFSET: usize = 9usize
const PAT_LARGE_BITS: usize = 1usize
const PAT_LARGE_OFFSET: usize = 12usize
const PHYS_ADDR_51_21_BITS: usize = 31usize
const PHYS_ADDR_51_21_OFFSET: usize = 21usize
const OS_AVAILABLE_HIGH_BITS: usize = 7usize
const OS_AVAILABLE_HIGH_OFFSET: usize = 52usize
const PROTECTION_KEY_BITS: usize = 4usize
const PROTECTION_KEY_OFFSET: usize = 59usize
const NO_EXECUTE_BITS: usize = 1usize
const NO_EXECUTE_OFFSET: usize = 63usize
Sourcepub const fn with_present_checked(self, value: bool) -> Result<Self, ()>
 
pub const fn with_present_checked(self, value: bool) -> Result<Self, ()>
Present (bit 0).
Bits: 0..1
Sourcepub const fn with_present(self, value: bool) -> Self
 
pub const fn with_present(self, value: bool) -> Self
Present (bit 0).
Bits: 0..1
Sourcepub const fn set_present(&mut self, value: bool)
 
pub const fn set_present(&mut self, value: bool)
Present (bit 0).
Bits: 0..1
Sourcepub const fn set_present_checked(&mut self, value: bool) -> Result<(), ()>
 
pub const fn set_present_checked(&mut self, value: bool) -> Result<(), ()>
Present (bit 0).
Bits: 0..1
Sourcepub const fn with_writable_checked(self, value: bool) -> Result<Self, ()>
 
pub const fn with_writable_checked(self, value: bool) -> Result<Self, ()>
Writable (bit 1).
Bits: 1..2
Sourcepub const fn with_writable(self, value: bool) -> Self
 
pub const fn with_writable(self, value: bool) -> Self
Writable (bit 1).
Bits: 1..2
Sourcepub const fn set_writable(&mut self, value: bool)
 
pub const fn set_writable(&mut self, value: bool)
Writable (bit 1).
Bits: 1..2
Sourcepub const fn set_writable_checked(&mut self, value: bool) -> Result<(), ()>
 
pub const fn set_writable_checked(&mut self, value: bool) -> Result<(), ()>
Writable (bit 1).
Bits: 1..2
Sourcepub const fn with_user_checked(self, value: bool) -> Result<Self, ()>
 
pub const fn with_user_checked(self, value: bool) -> Result<Self, ()>
User (bit 2).
Bits: 2..3
Sourcepub const fn set_user_checked(&mut self, value: bool) -> Result<(), ()>
 
pub const fn set_user_checked(&mut self, value: bool) -> Result<(), ()>
User (bit 2).
Bits: 2..3
Sourcepub const fn write_through(&self) -> bool
 
pub const fn write_through(&self) -> bool
Write-Through (bit 3).
Bits: 3..4
Sourcepub const fn with_write_through_checked(self, value: bool) -> Result<Self, ()>
 
pub const fn with_write_through_checked(self, value: bool) -> Result<Self, ()>
Write-Through (bit 3).
Bits: 3..4
Sourcepub const fn with_write_through(self, value: bool) -> Self
 
pub const fn with_write_through(self, value: bool) -> Self
Write-Through (bit 3).
Bits: 3..4
Sourcepub const fn set_write_through(&mut self, value: bool)
 
pub const fn set_write_through(&mut self, value: bool)
Write-Through (bit 3).
Bits: 3..4
Sourcepub const fn set_write_through_checked(&mut self, value: bool) -> Result<(), ()>
 
pub const fn set_write_through_checked(&mut self, value: bool) -> Result<(), ()>
Write-Through (bit 3).
Bits: 3..4
Sourcepub const fn cache_disable(&self) -> bool
 
pub const fn cache_disable(&self) -> bool
Cache Disable (bit 4).
Bits: 4..5
Sourcepub const fn with_cache_disable_checked(self, value: bool) -> Result<Self, ()>
 
pub const fn with_cache_disable_checked(self, value: bool) -> Result<Self, ()>
Cache Disable (bit 4).
Bits: 4..5
Sourcepub const fn with_cache_disable(self, value: bool) -> Self
 
pub const fn with_cache_disable(self, value: bool) -> Self
Cache Disable (bit 4).
Bits: 4..5
Sourcepub const fn set_cache_disable(&mut self, value: bool)
 
pub const fn set_cache_disable(&mut self, value: bool)
Cache Disable (bit 4).
Bits: 4..5
Sourcepub const fn set_cache_disable_checked(&mut self, value: bool) -> Result<(), ()>
 
pub const fn set_cache_disable_checked(&mut self, value: bool) -> Result<(), ()>
Cache Disable (bit 4).
Bits: 4..5
Sourcepub const fn with_accessed_checked(self, value: bool) -> Result<Self, ()>
 
pub const fn with_accessed_checked(self, value: bool) -> Result<Self, ()>
Accessed (bit 5).
Bits: 5..6
Sourcepub const fn with_accessed(self, value: bool) -> Self
 
pub const fn with_accessed(self, value: bool) -> Self
Accessed (bit 5).
Bits: 5..6
Sourcepub const fn set_accessed(&mut self, value: bool)
 
pub const fn set_accessed(&mut self, value: bool)
Accessed (bit 5).
Bits: 5..6
Sourcepub const fn set_accessed_checked(&mut self, value: bool) -> Result<(), ()>
 
pub const fn set_accessed_checked(&mut self, value: bool) -> Result<(), ()>
Accessed (bit 5).
Bits: 5..6
Sourcepub const fn dirty(&self) -> bool
 
pub const fn dirty(&self) -> bool
Dirty (bit 6): set by CPU on first write to this 2 MiB page.
Bits: 6..7
Sourcepub const fn with_dirty_checked(self, value: bool) -> Result<Self, ()>
 
pub const fn with_dirty_checked(self, value: bool) -> Result<Self, ()>
Dirty (bit 6): set by CPU on first write to this 2 MiB page.
Bits: 6..7
Sourcepub const fn with_dirty(self, value: bool) -> Self
 
pub const fn with_dirty(self, value: bool) -> Self
Dirty (bit 6): set by CPU on first write to this 2 MiB page.
Bits: 6..7
Sourcepub const fn set_dirty(&mut self, value: bool)
 
pub const fn set_dirty(&mut self, value: bool)
Dirty (bit 6): set by CPU on first write to this 2 MiB page.
Bits: 6..7
Sourcepub const fn set_dirty_checked(&mut self, value: bool) -> Result<(), ()>
 
pub const fn set_dirty_checked(&mut self, value: bool) -> Result<(), ()>
Dirty (bit 6): set by CPU on first write to this 2 MiB page.
Bits: 6..7
Sourcepub(crate) const fn page_size(&self) -> bool
 
pub(crate) const fn page_size(&self) -> bool
Page Size (bit 7): must be 1 for 2 MiB leaf.
Bits: 7..8
Sourcepub(crate) const fn with_page_size_checked(
    self,
    value: bool,
) -> Result<Self, ()>
 
pub(crate) const fn with_page_size_checked( self, value: bool, ) -> Result<Self, ()>
Page Size (bit 7): must be 1 for 2 MiB leaf.
Bits: 7..8
Sourcepub(crate) const fn with_page_size(self, value: bool) -> Self
 
pub(crate) const fn with_page_size(self, value: bool) -> Self
Page Size (bit 7): must be 1 for 2 MiB leaf.
Bits: 7..8
Sourcepub(crate) const fn set_page_size(&mut self, value: bool)
 
pub(crate) const fn set_page_size(&mut self, value: bool)
Page Size (bit 7): must be 1 for 2 MiB leaf.
Bits: 7..8
Sourcepub(crate) const fn set_page_size_checked(
    &mut self,
    value: bool,
) -> Result<(), ()>
 
pub(crate) const fn set_page_size_checked( &mut self, value: bool, ) -> Result<(), ()>
Page Size (bit 7): must be 1 for 2 MiB leaf.
Bits: 7..8
Sourcepub const fn global(&self) -> bool
 
pub const fn global(&self) -> bool
Global (bit 8): TLB entry not flushed on CR3 reload.
Bits: 8..9
Sourcepub const fn with_global_checked(self, value: bool) -> Result<Self, ()>
 
pub const fn with_global_checked(self, value: bool) -> Result<Self, ()>
Global (bit 8): TLB entry not flushed on CR3 reload.
Bits: 8..9
Sourcepub const fn with_global(self, value: bool) -> Self
 
pub const fn with_global(self, value: bool) -> Self
Global (bit 8): TLB entry not flushed on CR3 reload.
Bits: 8..9
Sourcepub const fn set_global(&mut self, value: bool)
 
pub const fn set_global(&mut self, value: bool)
Global (bit 8): TLB entry not flushed on CR3 reload.
Bits: 8..9
Sourcepub const fn set_global_checked(&mut self, value: bool) -> Result<(), ()>
 
pub const fn set_global_checked(&mut self, value: bool) -> Result<(), ()>
Global (bit 8): TLB entry not flushed on CR3 reload.
Bits: 8..9
Sourcepub const fn os_available_low(&self) -> u8
 
pub const fn os_available_low(&self) -> u8
OS-available low (bits 9..11).
Bits: 9..12
Sourcepub const fn with_os_available_low_checked(self, value: u8) -> Result<Self, ()>
 
pub const fn with_os_available_low_checked(self, value: u8) -> Result<Self, ()>
OS-available low (bits 9..11).
Bits: 9..12
Sourcepub const fn with_os_available_low(self, value: u8) -> Self
 
pub const fn with_os_available_low(self, value: u8) -> Self
OS-available low (bits 9..11).
Bits: 9..12
Sourcepub const fn set_os_available_low(&mut self, value: u8)
 
pub const fn set_os_available_low(&mut self, value: u8)
OS-available low (bits 9..11).
Bits: 9..12
Sourcepub const fn set_os_available_low_checked(
    &mut self,
    value: u8,
) -> Result<(), ()>
 
pub const fn set_os_available_low_checked( &mut self, value: u8, ) -> Result<(), ()>
OS-available low (bits 9..11).
Bits: 9..12
Sourcepub const fn pat_large(&self) -> bool
 
pub const fn pat_large(&self) -> bool
PAT (Page Attribute Table) selector for 2 MiB mappings (bit 12).
Bits: 12..13
Sourcepub const fn with_pat_large_checked(self, value: bool) -> Result<Self, ()>
 
pub const fn with_pat_large_checked(self, value: bool) -> Result<Self, ()>
PAT (Page Attribute Table) selector for 2 MiB mappings (bit 12).
Bits: 12..13
Sourcepub const fn with_pat_large(self, value: bool) -> Self
 
pub const fn with_pat_large(self, value: bool) -> Self
PAT (Page Attribute Table) selector for 2 MiB mappings (bit 12).
Bits: 12..13
Sourcepub const fn set_pat_large(&mut self, value: bool)
 
pub const fn set_pat_large(&mut self, value: bool)
PAT (Page Attribute Table) selector for 2 MiB mappings (bit 12).
Bits: 12..13
Sourcepub const fn set_pat_large_checked(&mut self, value: bool) -> Result<(), ()>
 
pub const fn set_pat_large_checked(&mut self, value: bool) -> Result<(), ()>
PAT (Page Attribute Table) selector for 2 MiB mappings (bit 12).
Bits: 12..13
Sourceconst fn phys_addr_51_21(&self) -> u32
 
const fn phys_addr_51_21(&self) -> u32
Physical address bits 51:21 (2 MiB-aligned base).
Bits: 21..52
Sourceconst fn with_phys_addr_51_21_checked(self, value: u32) -> Result<Self, ()>
 
const fn with_phys_addr_51_21_checked(self, value: u32) -> Result<Self, ()>
Physical address bits 51:21 (2 MiB-aligned base).
Bits: 21..52
Sourceconst fn with_phys_addr_51_21(self, value: u32) -> Self
 
const fn with_phys_addr_51_21(self, value: u32) -> Self
Physical address bits 51:21 (2 MiB-aligned base).
Bits: 21..52
Sourceconst fn set_phys_addr_51_21(&mut self, value: u32)
 
const fn set_phys_addr_51_21(&mut self, value: u32)
Physical address bits 51:21 (2 MiB-aligned base).
Bits: 21..52
Sourceconst fn set_phys_addr_51_21_checked(&mut self, value: u32) -> Result<(), ()>
 
const fn set_phys_addr_51_21_checked(&mut self, value: u32) -> Result<(), ()>
Physical address bits 51:21 (2 MiB-aligned base).
Bits: 21..52
Sourcepub const fn os_available_high(&self) -> u8
 
pub const fn os_available_high(&self) -> u8
OS-available high (bits 52..58).
Bits: 52..59
Sourcepub const fn with_os_available_high_checked(self, value: u8) -> Result<Self, ()>
 
pub const fn with_os_available_high_checked(self, value: u8) -> Result<Self, ()>
OS-available high (bits 52..58).
Bits: 52..59
Sourcepub const fn with_os_available_high(self, value: u8) -> Self
 
pub const fn with_os_available_high(self, value: u8) -> Self
OS-available high (bits 52..58).
Bits: 52..59
Sourcepub const fn set_os_available_high(&mut self, value: u8)
 
pub const fn set_os_available_high(&mut self, value: u8)
OS-available high (bits 52..58).
Bits: 52..59
Sourcepub const fn set_os_available_high_checked(
    &mut self,
    value: u8,
) -> Result<(), ()>
 
pub const fn set_os_available_high_checked( &mut self, value: u8, ) -> Result<(), ()>
OS-available high (bits 52..58).
Bits: 52..59
Sourcepub const fn protection_key(&self) -> u8
 
pub const fn protection_key(&self) -> u8
Protection Key / OS use (59..62).
Bits: 59..63
Sourcepub const fn with_protection_key_checked(self, value: u8) -> Result<Self, ()>
 
pub const fn with_protection_key_checked(self, value: u8) -> Result<Self, ()>
Protection Key / OS use (59..62).
Bits: 59..63
Sourcepub const fn with_protection_key(self, value: u8) -> Self
 
pub const fn with_protection_key(self, value: u8) -> Self
Protection Key / OS use (59..62).
Bits: 59..63
Sourcepub const fn set_protection_key(&mut self, value: u8)
 
pub const fn set_protection_key(&mut self, value: u8)
Protection Key / OS use (59..62).
Bits: 59..63
Sourcepub const fn set_protection_key_checked(&mut self, value: u8) -> Result<(), ()>
 
pub const fn set_protection_key_checked(&mut self, value: u8) -> Result<(), ()>
Protection Key / OS use (59..62).
Bits: 59..63
Sourcepub const fn no_execute(&self) -> bool
 
pub const fn no_execute(&self) -> bool
No-Execute (bit 63).
Bits: 63..64
Sourcepub const fn with_no_execute_checked(self, value: bool) -> Result<Self, ()>
 
pub const fn with_no_execute_checked(self, value: bool) -> Result<Self, ()>
No-Execute (bit 63).
Bits: 63..64
Sourcepub const fn with_no_execute(self, value: bool) -> Self
 
pub const fn with_no_execute(self, value: bool) -> Self
No-Execute (bit 63).
Bits: 63..64
Sourcepub const fn set_no_execute(&mut self, value: bool)
 
pub const fn set_no_execute(&mut self, value: bool)
No-Execute (bit 63).
Bits: 63..64
Source§impl Pde2M
 
impl Pde2M
Sourcepub const fn with_physical_page(self, phys: PhysicalPage<Size2M>) -> Self
 
pub const fn with_physical_page(self, phys: PhysicalPage<Size2M>) -> Self
Set the 2 MiB page base (must be 2 MiB-aligned).
Sourcepub const fn set_physical_page(&mut self, phys: PhysicalPage<Size2M>)
 
pub const fn set_physical_page(&mut self, phys: PhysicalPage<Size2M>)
Set the 2 MiB page base (must be 2 MiB-aligned).
Sourcepub const fn physical_page(self) -> PhysicalPage<Size2M>
 
pub const fn physical_page(self) -> PhysicalPage<Size2M>
Get the 2 MiB page base.
Sourcepub const fn new_common_rw() -> Self
 
pub const fn new_common_rw() -> Self
Leaf PDE with common kernel RW flags.