MCPcopy Create free account
hub / github.com/Ruddle/Fomos / init

Function init

bootloader/kernel/src/memory.rs:12–15  ·  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

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

Callers

nothing calls this directly

Calls 1

active_level_4_tableFunction · 0.85

Tested by

no test coverage detected