[][src]Trait sunrise_kernel::frame_allocator::private::FrameAllocatorTraitPrivate

pub trait FrameAllocatorTraitPrivate {
    fn free_region(region: &PhysicalMemRegion);
fn check_is_allocated(address: PhysicalAddress, length: usize) -> bool;
fn check_is_reserved(region: PhysicalAddress, length: usize) -> bool; }

An arch-specifig FrameAllocator must expose the following functions.

These only provide an internal API for PhysicalMemRegions.

Required methods

fn free_region(region: &PhysicalMemRegion)

Marks a region as deallocated. Called when a PhysicalMemRegion is dropped.

Panic

Panics if the region was not known as allocated

fn check_is_allocated(address: PhysicalAddress, length: usize) -> bool

Checks if a region is marked allocated.

fn check_is_reserved(region: PhysicalAddress, length: usize) -> bool

Checks if a region is marked reserved.

Loading content...

Implementors

impl FrameAllocatorTraitPrivate for FrameAllocator[src]

fn free_region(region: &PhysicalMemRegion)[src]

Frees an allocated physical region.

Panic

  • Panics if the frame was not allocated.
  • Panics if FRAME_ALLOCATOR was not initialized.

fn check_is_allocated(address: PhysicalAddress, length: usize) -> bool[src]

Checks that a physical region is marked allocated.

Rounds address and length.

Panic

  • Panics if FRAME_ALLOCATOR was not initialized.

fn check_is_reserved(address: PhysicalAddress, length: usize) -> bool[src]

Checks that a physical region is marked reserved. This implementation does not distinguish between allocated and reserved frames, so for us it's equivalent to check_is_allocated.

Rounds address and length.

Panic

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