Skip to main content

allocate_frame

Function allocate_frame 

Source
pub fn allocate_frame(token: &IrqDisabledToken) -> Result<PhysFrame, AllocError>
Expand description

Allocate a single zeroed physical frame with KernelData purpose.

This is the standard allocation path for all kernel-internal frames. It uses FrameAllocOptions::new() (zeroed = true, purpose = KernelData) and performs the UNUSED → 0 → 1 refcount CAS (Asterinas OSTD pattern).

For page-table node allocation use BuddyFrameAllocator (via paging.rs) or FrameAllocOptions::new().purpose(FramePurpose::PageTable).allocate(). For user-space frames use FrameAllocOptions::new().purpose(FramePurpose::UserData).