pub struct IdentityMapBuilder<'a> { /* private fields */ }Expand description
An IdentityMap Builder, which builds either a 4GB or 8GB identity map of the lower address space FUTURE: This logic can merged with the PageTableBuilder, rather than maintaining two implementations
Implementations§
Source§impl<'a> IdentityMapBuilder<'a>
impl<'a> IdentityMapBuilder<'a>
Sourcepub fn new(
page_table_gpa: u64,
identity_map_size: IdentityMapSize,
page_table: &'a mut [PageTable],
flattened_page_table: &'a mut [u8],
) -> Result<Self, Error>
pub fn new( page_table_gpa: u64, identity_map_size: IdentityMapSize, page_table: &'a mut [PageTable], flattened_page_table: &'a mut [u8], ) -> Result<Self, Error>
Creates a new instance of the IdentityMapBuilder. The PageTable slice is working memory for constructing the page table, and the u8 slice is the memory used to output the final bytes of the page table
The working memory and output memory are taken as parameters to allow for the caller to flexibly choose their allocation strategy, to support usage in no_std environments like openhcl_boot
Sourcepub fn with_address_bias(self, address_bias: u64) -> Self
pub fn with_address_bias(self, address_bias: u64) -> Self
Builds the page tables with an address bias, a fixed offset between the virtual and physical addresses in the identity map
Sourcepub fn with_pml4e_link(self, pml4e_link: (u64, u64)) -> Self
pub fn with_pml4e_link(self, pml4e_link: (u64, u64)) -> Self
An optional PML4E entry may be linked, with arguments being (link_target_gpa, linkage_gpa). link_target_gpa represents the GPA of the PML4E to link into the built page table. linkage_gpa represents the GPA at which the linked PML4E should be linked.