MCPcopy Create free account
hub / github.com/IntegralPilot/wasm_os / init

Function init

src/memory.rs:13–18  ·  view source on GitHub ↗

Initialize a new OffsetPageTable. This function is unsafe because the caller must guarantee that the complete physical memory is mapped to virtual memory at the passed `physical_memory_offset`. Also, this function must be only called once to avoid aliasing `&mut` references (which is undefined behavior).

(physical_memory_offset: VirtAddr)

Source from the content-addressed store, hash-verified

11/// `physical_memory_offset`. Also, this function must be only called once
12/// to avoid aliasing `&mut` references (which is undefined behavior).
13pub unsafe fn init(physical_memory_offset: VirtAddr) -> OffsetPageTable<'static> {
14 unsafe {
15 let level_4_table = active_level_4_table(physical_memory_offset);
16 OffsetPageTable::new(level_4_table, physical_memory_offset)
17 }
18}
19
20/// Returns a mutable reference to the active level 4 table.
21///

Callers

nothing calls this directly

Calls 1

active_level_4_tableFunction · 0.85

Tested by

no test coverage detected