Pde

Struct Pde 

Source
#[repr(transparent)]
pub struct Pde(u64);
Expand description

L2 PDE — pointer to a Page Table (non-leaf; PS = 0).

  • Physical address (bits 51:12) is a 4 KiB-aligned PT.
  • In non-leaf PDEs, PAT lives at bit 12 only in the leaf form; here, all bits 12..51 are the next-level table address.

Tuple Fields§

§0: u64

Implementations§

Source§

impl Pde

Source

const PRESENT_BITS: usize = 1usize

Source

const PRESENT_OFFSET: usize = 0usize

Source

const WRITABLE_BITS: usize = 1usize

Source

const WRITABLE_OFFSET: usize = 1usize

Source

const USER_BITS: usize = 1usize

Source

const USER_OFFSET: usize = 2usize

Source

const WRITE_THROUGH_BITS: usize = 1usize

Source

const WRITE_THROUGH_OFFSET: usize = 3usize

Source

const CACHE_DISABLE_BITS: usize = 1usize

Source

const CACHE_DISABLE_OFFSET: usize = 4usize

Source

const ACCESSED_BITS: usize = 1usize

Source

const ACCESSED_OFFSET: usize = 5usize

Source

const OS_AVAILABLE_LOW_BITS: usize = 3usize

Source

const OS_AVAILABLE_LOW_OFFSET: usize = 9usize

Source

const PHYS_ADDR_51_12_BITS: usize = 40usize

Source

const PHYS_ADDR_51_12_OFFSET: usize = 12usize

Source

const OS_AVAILABLE_HIGH_BITS: usize = 7usize

Source

const OS_AVAILABLE_HIGH_OFFSET: usize = 52usize

Source

const PROTECTION_KEY_BITS: usize = 4usize

Source

const PROTECTION_KEY_OFFSET: usize = 59usize

Source

const NO_EXECUTE_BITS: usize = 1usize

Source

const NO_EXECUTE_OFFSET: usize = 63usize

Source

pub const fn new() -> Self

Creates a new default initialized bitfield.

Source

pub const fn from_bits(bits: u64) -> Self

Convert from bits.

Source

pub const fn into_bits(self) -> u64

Convert into bits.

Source

pub const fn present(&self) -> bool

Present (bit 0).

Bits: 0..1

Source

pub const fn with_present_checked(self, value: bool) -> Result<Self, ()>

Present (bit 0).

Bits: 0..1

Source

pub const fn with_present(self, value: bool) -> Self

Present (bit 0).

Bits: 0..1

Source

pub const fn set_present(&mut self, value: bool)

Present (bit 0).

Bits: 0..1

Source

pub const fn set_present_checked(&mut self, value: bool) -> Result<(), ()>

Present (bit 0).

Bits: 0..1

Source

pub const fn writable(&self) -> bool

Writable (bit 1).

Bits: 1..2

Source

pub const fn with_writable_checked(self, value: bool) -> Result<Self, ()>

Writable (bit 1).

Bits: 1..2

Source

pub const fn with_writable(self, value: bool) -> Self

Writable (bit 1).

Bits: 1..2

Source

pub const fn set_writable(&mut self, value: bool)

Writable (bit 1).

Bits: 1..2

Source

pub const fn set_writable_checked(&mut self, value: bool) -> Result<(), ()>

Writable (bit 1).

Bits: 1..2

Source

pub const fn user(&self) -> bool

User (bit 2).

Bits: 2..3

Source

pub const fn with_user_checked(self, value: bool) -> Result<Self, ()>

User (bit 2).

Bits: 2..3

Source

pub const fn with_user(self, value: bool) -> Self

User (bit 2).

Bits: 2..3

Source

pub const fn set_user(&mut self, value: bool)

User (bit 2).

Bits: 2..3

Source

pub const fn set_user_checked(&mut self, value: bool) -> Result<(), ()>

User (bit 2).

Bits: 2..3

Source

pub const fn write_through(&self) -> bool

Write-Through (bit 3).

Bits: 3..4

Source

pub const fn with_write_through_checked(self, value: bool) -> Result<Self, ()>

Write-Through (bit 3).

Bits: 3..4

Source

pub const fn with_write_through(self, value: bool) -> Self

Write-Through (bit 3).

Bits: 3..4

Source

pub const fn set_write_through(&mut self, value: bool)

Write-Through (bit 3).

Bits: 3..4

Source

pub const fn set_write_through_checked(&mut self, value: bool) -> Result<(), ()>

Write-Through (bit 3).

Bits: 3..4

Source

pub const fn cache_disable(&self) -> bool

Cache Disable (bit 4).

Bits: 4..5

Source

pub const fn with_cache_disable_checked(self, value: bool) -> Result<Self, ()>

Cache Disable (bit 4).

Bits: 4..5

Source

pub const fn with_cache_disable(self, value: bool) -> Self

Cache Disable (bit 4).

Bits: 4..5

Source

pub const fn set_cache_disable(&mut self, value: bool)

Cache Disable (bit 4).

Bits: 4..5

Source

pub const fn set_cache_disable_checked(&mut self, value: bool) -> Result<(), ()>

Cache Disable (bit 4).

Bits: 4..5

Source

pub const fn accessed(&self) -> bool

Accessed (bit 5).

Bits: 5..6

Source

pub const fn with_accessed_checked(self, value: bool) -> Result<Self, ()>

Accessed (bit 5).

Bits: 5..6

Source

pub const fn with_accessed(self, value: bool) -> Self

Accessed (bit 5).

Bits: 5..6

Source

pub const fn set_accessed(&mut self, value: bool)

Accessed (bit 5).

Bits: 5..6

Source

pub const fn set_accessed_checked(&mut self, value: bool) -> Result<(), ()>

Accessed (bit 5).

Bits: 5..6

Source

pub const fn os_available_low(&self) -> u8

OS-available low (bits 9..11).

Bits: 9..12

Source

pub const fn with_os_available_low_checked(self, value: u8) -> Result<Self, ()>

OS-available low (bits 9..11).

Bits: 9..12

Source

pub const fn with_os_available_low(self, value: u8) -> Self

OS-available low (bits 9..11).

Bits: 9..12

Source

pub const fn set_os_available_low(&mut self, value: u8)

OS-available low (bits 9..11).

Bits: 9..12

Source

pub const fn set_os_available_low_checked( &mut self, value: u8, ) -> Result<(), ()>

OS-available low (bits 9..11).

Bits: 9..12

Source

const fn phys_addr_51_12(&self) -> u64

Next-level table physical address (bits 12..51, 4 KiB-aligned).

Note: Do not insert reserved placeholders here; in non-leaf form these bits are entirely the PT base address.

Bits: 12..52

Source

const fn with_phys_addr_51_12_checked(self, value: u64) -> Result<Self, ()>

Next-level table physical address (bits 12..51, 4 KiB-aligned).

Note: Do not insert reserved placeholders here; in non-leaf form these bits are entirely the PT base address.

Bits: 12..52

Source

const fn with_phys_addr_51_12(self, value: u64) -> Self

Next-level table physical address (bits 12..51, 4 KiB-aligned).

Note: Do not insert reserved placeholders here; in non-leaf form these bits are entirely the PT base address.

Bits: 12..52

Source

const fn set_phys_addr_51_12(&mut self, value: u64)

Next-level table physical address (bits 12..51, 4 KiB-aligned).

Note: Do not insert reserved placeholders here; in non-leaf form these bits are entirely the PT base address.

Bits: 12..52

Source

const fn set_phys_addr_51_12_checked(&mut self, value: u64) -> Result<(), ()>

Next-level table physical address (bits 12..51, 4 KiB-aligned).

Note: Do not insert reserved placeholders here; in non-leaf form these bits are entirely the PT base address.

Bits: 12..52

Source

pub const fn os_available_high(&self) -> u8

OS-available high (bits 52..58).

Bits: 52..59

Source

pub const fn with_os_available_high_checked(self, value: u8) -> Result<Self, ()>

OS-available high (bits 52..58).

Bits: 52..59

Source

pub const fn with_os_available_high(self, value: u8) -> Self

OS-available high (bits 52..58).

Bits: 52..59

Source

pub const fn set_os_available_high(&mut self, value: u8)

OS-available high (bits 52..58).

Bits: 52..59

Source

pub const fn set_os_available_high_checked( &mut self, value: u8, ) -> Result<(), ()>

OS-available high (bits 52..58).

Bits: 52..59

Source

pub const fn protection_key(&self) -> u8

Protection Key / OS use (59..62).

Bits: 59..63

Source

pub const fn with_protection_key_checked(self, value: u8) -> Result<Self, ()>

Protection Key / OS use (59..62).

Bits: 59..63

Source

pub const fn with_protection_key(self, value: u8) -> Self

Protection Key / OS use (59..62).

Bits: 59..63

Source

pub const fn set_protection_key(&mut self, value: u8)

Protection Key / OS use (59..62).

Bits: 59..63

Source

pub const fn set_protection_key_checked(&mut self, value: u8) -> Result<(), ()>

Protection Key / OS use (59..62).

Bits: 59..63

Source

pub const fn no_execute(&self) -> bool

No-Execute (bit 63).

Bits: 63..64

Source

pub const fn with_no_execute_checked(self, value: bool) -> Result<Self, ()>

No-Execute (bit 63).

Bits: 63..64

Source

pub const fn with_no_execute(self, value: bool) -> Self

No-Execute (bit 63).

Bits: 63..64

Source

pub const fn set_no_execute(&mut self, value: bool)

No-Execute (bit 63).

Bits: 63..64

Source

pub const fn set_no_execute_checked(&mut self, value: bool) -> Result<(), ()>

No-Execute (bit 63).

Bits: 63..64

Source§

impl Pde

Source

pub const fn with_physical_page(self, phys: PhysicalPage<Size4K>) -> Self

Set the Page Table base (4 KiB-aligned).

Source

pub const fn set_physical_page(&mut self, phys: PhysicalPage<Size4K>)

Set the Page Table base (4 KiB-aligned).

Source

pub const fn physical_address(self) -> PhysicalPage<Size4K>

Get the Page Table base.

Source

pub const fn new_common_rw() -> Self

Non-leaf PDE with common kernel RW flags.

Trait Implementations§

Source§

impl Clone for Pde

Source§

fn clone(&self) -> Pde

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Pde

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Pde

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<Pde> for PdEntry

Source§

fn from(e: Pde) -> Self

Converts to this type from the input type.
Source§

impl From<Pde> for VirtualMemoryPageBits

Source§

fn from(e: Pde) -> Self

Converts to this type from the input type.
Source§

impl From<Pde> for u64

Source§

fn from(v: Pde) -> u64

Converts to this type from the input type.
Source§

impl From<u64> for Pde

Source§

fn from(v: u64) -> Self

Converts to this type from the input type.
Source§

impl Copy for Pde

Auto Trait Implementations§

§

impl Freeze for Pde

§

impl RefUnwindSafe for Pde

§

impl Send for Pde

§

impl Sync for Pde

§

impl Unpin for Pde

§

impl UnwindSafe for Pde

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.