MCPcopy Create free account
hub / github.com/IBM/ACE-RISCV / initialize

Method initialize

security-monitor/src/core/page_allocator/allocator.rs:88–97  ·  view source on GitHub ↗
(memory_start: ConfidentialMemoryAddress, memory_end: *const usize)

Source from the content-addressed store, hash-verified

86 #[rr::ensures(#iris "once_initialized π \"PAGE_ALLOCATOR\" (Some ())")]
87 #[rr::returns("Ok(())")]
88 pub unsafe fn initialize(memory_start: ConfidentialMemoryAddress, memory_end: *const usize) -> Result<(), Error> {
89 ensure_not!(PAGE_ALLOCATOR.is_completed(), Error::Reinitialization())?;
90 let mut page_allocator = Self::empty();
91 unsafe { page_allocator.add_memory_region(memory_start, memory_end)? };
92 PAGE_ALLOCATOR.call_once(
93 #[rr::verify]
94 || RwLock::new(page_allocator),
95 );
96 Ok(())
97 }
98
99 /// Specification:
100 /// Postcondition: an initialized memory allocator is returned

Callers

nothing calls this directly

Calls 1

add_memory_regionMethod · 0.80

Tested by

no test coverage detected