fn map_page<S: PageSize>(
		&mut self,
		page: Page<S>,
		physical_address: usize,
		flags: PageTableEntryFlags,
	) -> bool {
		assert!(L::LEVEL >= S::MAP_LEVEL);

		if L::LEVEL > S::MAP_LEVEL {
			let index = page.table_index::<L>();

			// Does the table exist yet?
			if !self.entries[index].is_present() {
				// Allocate a single 4 KiB page for the new entry and mark it as a valid, writable subtable.
				let physical_address = physicalmem::allocate(BasePageSize::SIZE).unwrap();
			    self.entries[index].set(physical_address, PageTableEntryFlags::WRITABLE);

				// Mark all entries as unused in the newly created table.
				let subtable = self.subtable::<S>(page);
				for entry in subtable.entries.iter_mut() {
					entry.physical_address_and_flags = 0;
				}
			}

			let subtable = self.subtable::<S>(page);
			subtable.map_page::<S>(page, physical_address, flags)
		} else {
			// Calling the default implementation from a specialized one is not supported (yet),
			// so we have to resort to an extra function.
			self.map_page_in_this_table::<S>(page, physical_address, flags)
		}
	}
/// Maps a single page to the given physical address.
/// Returns whether an existing entry was updated. You can use this return value to flush TLBs.
///
/// This is the implementation for all tables with subtables (PML4, PDPT, PDT).
/// It overrides the default implementation above.
Maps a single page to the given physical address.
Returns whether an existing entry was updated. You can use this return value to flush TLBs.

This is the implementation for all tables with subtables (PML4, PDPT, PDT).
It overrides the default implementation above.
Maps a single page to the given physical address . Returns whether an existing entry was updated . You can use this return value to flush TLBs . This is the implementation for all tables with subtables ( PML4 PDPT PDT ) . It overrides the default implementation above .
fn map_page<S: PageSize>(
		&mut self,
		page: Page<S>,
		physical_address: usize,
		flags: PageTableEntryFlags,
	) -> bool {
		assert!(L::LEVEL >= S::MAP_LEVEL);
		if L::LEVEL > S::MAP_LEVEL {
			let index = page.table_index::<L>();
			// Does the table exist yet?
			if !self.entries[index].is_present() {
				// Allocate a single 4 KiB page for the new entry and mark it as a valid, writable subtable.
				let physical_address = physicalmem::allocate(BasePageSize::SIZE).unwrap();
			    self.entries[index].set(physical_address, PageTableEntryFlags::WRITABLE);
				// Mark all entries as unused in the newly created table.
				let subtable = self.subtable::<S>(page);
				for entry in subtable.entries.iter_mut() {
					entry.physical_address_and_flags = 0;
				}
			}
			let subtable = self.subtable::<S>(page);
			subtable.map_page::<S>(page, physical_address, flags)
		} else {
			// Calling the default implementation from a specialized one is not supported (yet),
			// so we have to resort to an extra function.
			self.map_page_in_this_table::<S>(page, physical_address, flags)
		}
	}
fn map_page < S : PageSize > ( & mut self , page : Page < S > , physical_address : usize , flags : PageTableEntryFlags , ) -> bool { assert ! ( L LEVEL S MAP_LEVEL ) ; if L :: LEVEL > S :: MAP_LEVEL { let index = page . table_index :: < L > ( ) ; // Does the table exist yet? if ! self . entries [ index ] . is_present ( ) { // Allocate a single 4 KiB page for the new entry and mark it as a valid, writable subtable. let physical_address = physicalmem :: allocate ( BasePageSize :: SIZE ) . unwrap ( ) ; self . entries [ index ] . set ( physical_address , PageTableEntryFlags :: WRITABLE ) ; // Mark all entries as unused in the newly created table. let subtable = self . subtable :: < S > ( page ) ; for entry in subtable . entries . iter_mut ( ) { entry . physical_address_and_flags = 0 ; } } let subtable = self . subtable :: < S > ( page ) ; subtable . map_page :: < S > ( page , physical_address , flags ) } else { // Calling the default implementation from a specialized one is not supported (yet), // so we have to resort to an extra function. self . map_page_in_this_table :: < S > ( page , physical_address , flags ) } }
Maps a single page to the given physical address.
Maps a single page to the given physical address .
&mut self
page
Page<S>
physical_address
usize
flags
PageTableEntryFlags
&mut self
page
Page<S>
physical_address
usize
flags
PageTableEntryFlags