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

Function allocate_active_pages

kernel/src/memory.rs:300–310  ·  view source on GitHub ↗

Allocate pages in the active page table Inputs ------ start_addr Virtual address in the first page size Size of the region in bytes. flags Set permissions / properties

(
    start_addr: VirtAddr,
    size: u64,
    flags: PageTableFlags)

Source from the content-addressed store, hash-verified

298/// flags Set permissions / properties
299///
300pub fn allocate_active_pages(
301 start_addr: VirtAddr,
302 size: u64,
303 flags: PageTableFlags)
304 -> Result<(), MapToError<Size4KiB>> {
305
306 let memory_info = unsafe {MEMORY_INFO.as_mut().unwrap()};
307 let level_4_table = unsafe {active_level_4_table(memory_info.physical_memory_offset)};
308
309 allocate_pages(&mut *level_4_table, start_addr, size, flags)
310}
311
312/// Create user-accessible pages, which are allocated on demand
313/// ie when written to.

Callers

nothing calls this directly

Calls 2

active_level_4_tableFunction · 0.85
allocate_pagesFunction · 0.85

Tested by

no test coverage detected