[][src]Trait sunrise_kernel::frame_allocator::FrameAllocatorTrait

pub trait FrameAllocatorTrait: FrameAllocatorTraitPrivate {
    fn allocate_region(length: usize) -> Result<PhysicalMemRegion, KernelError>;
fn allocate_frames_fragmented(
        length: usize
    ) -> Result<Vec<PhysicalMemRegion>, KernelError>; fn allocate_frame() -> Result<PhysicalMemRegion, KernelError> { ... } }

An arch-specific FrameAllocator must expose the following functions

Required methods

fn allocate_region(length: usize) -> Result<PhysicalMemRegion, KernelError>

Allocates a single PhysicalMemRegion. Frames are physically consecutive.

fn allocate_frames_fragmented(
    length: usize
) -> Result<Vec<PhysicalMemRegion>, KernelError>

Allocates physical frames, possibly fragmented across several physical regions.

Loading content...

Provided methods

fn allocate_frame() -> Result<PhysicalMemRegion, KernelError>

Allocates a single physical frame.

Loading content...

Implementors

impl FrameAllocatorTrait for FrameAllocator[src]

fn allocate_region(length: usize) -> Result<PhysicalMemRegion, KernelError>[src]

Allocates a single PhysicalMemRegion. Frames are physically consecutive.

Errors

  • InvalidSize
    • length is not page size aligned.
    • length is 0.

Panics

fn allocate_frames_fragmented(
    length: usize
) -> Result<Vec<PhysicalMemRegion>, KernelError>
[src]

Allocates physical frames, possibly fragmented across several physical regions.

Errors

  • InvalidSize:
    • length is not page size aligned.
    • length is 0.

Panics

  • Panics if FRAME_ALLOCATOR was not initialized.
Loading content...