pub struct PageTableBuilder { /* private fields */ }Expand description
Builder for x86_64 4-level page tables.
Implementations§
Source§impl PageTableBuilder
impl PageTableBuilder
Sourcepub fn map_4k(self, vaddr: u64, paddr: u64, page_flags: u64) -> Self
pub fn map_4k(self, vaddr: u64, paddr: u64, page_flags: u64) -> Self
Map a 4K virtual address to a physical address with given flags.
Sourcepub fn map_2m(self, vaddr: u64, paddr: u64, page_flags: u64) -> Self
pub fn map_2m(self, vaddr: u64, paddr: u64, page_flags: u64) -> Self
Map a 2MB large page (sets PS bit at PD level).
Sourcepub fn map_1g(self, vaddr: u64, paddr: u64, page_flags: u64) -> Self
pub fn map_1g(self, vaddr: u64, paddr: u64, page_flags: u64) -> Self
Map a 1GB huge page (sets PS bit at PDPT level).
Sourcepub fn map_demand_zero(self, vaddr: u64) -> Self
pub fn map_demand_zero(self, vaddr: u64) -> Self
Map a demand-zero PTE: upper levels present, PT entry = 0.
Sourcepub fn map_transition(self, vaddr: u64, pfn: u64) -> Self
pub fn map_transition(self, vaddr: u64, pfn: u64) -> Self
Map a transition PTE: PRESENT=0, bit 11 (TRANSITION)=1, PFN in bits [12..48].
Sourcepub fn map_pagefile(
self,
vaddr: u64,
pagefile_num: u8,
page_offset: u64,
) -> Self
pub fn map_pagefile( self, vaddr: u64, pagefile_num: u8, page_offset: u64, ) -> Self
Map a pagefile PTE: PRESENT=0, pagefile_num in bits [1..5], page_offset in bits [12..48].
Sourcepub fn map_prototype(self, vaddr: u64) -> Self
pub fn map_prototype(self, vaddr: u64) -> Self
Map a prototype PTE: PRESENT=0, bit 10 (PROTOTYPE)=1.
Sourcepub fn map_prototype_raw(self, vaddr: u64, raw_pte: u64) -> Self
pub fn map_prototype_raw(self, vaddr: u64, raw_pte: u64) -> Self
Map a prototype PTE with a specific raw PTE value. Bit 10 must be set.
Sourcepub fn write_phys(self, addr: u64, data: &[u8]) -> Self
pub fn write_phys(self, addr: u64, data: &[u8]) -> Self
Write data bytes at a physical address in the synthetic memory.
Sourcepub fn write_phys_u64(self, addr: u64, value: u64) -> Self
pub fn write_phys_u64(self, addr: u64, value: u64) -> Self
Write a u64 value at a physical address.
Sourcepub fn build(self) -> (u64, SyntheticPhysMem)
pub fn build(self) -> (u64, SyntheticPhysMem)
Consume the builder and return the CR3 value + synthetic memory.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PageTableBuilder
impl RefUnwindSafe for PageTableBuilder
impl Send for PageTableBuilder
impl Sync for PageTableBuilder
impl Unpin for PageTableBuilder
impl UnsafeUnpin for PageTableBuilder
impl UnwindSafe for PageTableBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more