MCPcopy Create free account
hub / github.com/bendudson/EuraliOS / active_level_1_table_containing

Function active_level_1_table_containing

kernel/src/memory.rs:788–803  ·  view source on GitHub ↗
(
    addr: VirtAddr
)

Source from the content-addressed store, hash-verified

786}
787
788fn active_level_1_table_containing(
789 addr: VirtAddr
790) -> &'static mut PageTable {
791 let memory_info = unsafe {MEMORY_INFO.as_mut().unwrap()};
792 let mut table = unsafe{&mut (*active_pagetable_ptr())};
793
794 for index in [addr.p4_index(),
795 addr.p3_index(),
796 addr.p2_index()] {
797
798 let entry = &mut table[index];
799 table = unsafe {&mut *(memory_info.physical_memory_offset
800 + entry.addr().as_u64()).as_mut_ptr()};
801 }
802 table
803}
804
805/// Allocate a read-only page which user code
806/// has attempted to write to.

Callers 2

free_user_stackFunction · 0.85

Calls 3

active_pagetable_ptrFunction · 0.85
as_mut_ptrMethod · 0.80
as_u64Method · 0.45

Tested by

no test coverage detected