[−][src]Struct sunrise_kernel::frame_allocator::i386::FrameAllocator
The physical memory manager.
Serves physical memory in atomic blocks of size PAGE_SIZE, called frames.
An allocation request returns a PhysicalMemRegion, which represents a list of
physically adjacent frames. When this returned PhysicalMemRegion
is eventually dropped
the frames are automatically freed and can be re-served by the FrameAllocator.
Trait Implementations
impl Debug for FrameAllocator
[src]
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
- Panics if FRAME_ALLOCATOR was not initialized.
fn allocate_frames_fragmented(
length: usize
) -> Result<Vec<PhysicalMemRegion>, KernelError>
[src]
length: usize
) -> Result<Vec<PhysicalMemRegion>, KernelError>
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.
fn allocate_frame() -> Result<PhysicalMemRegion, KernelError>
[src]
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.
Auto Trait Implementations
impl RefUnwindSafe for FrameAllocator
impl Send for FrameAllocator
impl Sync for FrameAllocator
impl Unpin for FrameAllocator
impl UnwindSafe for FrameAllocator
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,