Struct enarx_shim_kvm::allocator::EnarxAllocator
source · [−]pub struct EnarxAllocator { /* private fields */ }
Expand description
The allocator
The allocator struct is holding a linked list Heap allocator and information about the hypervisor’s capabilities to extend the available memory.
It also implements:
- paging::FrameAllocator
- paging::FrameAllocator
Implementations
sourceimpl EnarxAllocator
impl EnarxAllocator
sourcepub fn allocate_and_map_memory(
&mut self,
map_to: VirtAddr,
size: usize,
flags: PageTableFlags,
parent_flags: PageTableFlags
) -> Result<&'static mut [u8], AllocateError>
pub fn allocate_and_map_memory(
&mut self,
map_to: VirtAddr,
size: usize,
flags: PageTableFlags,
parent_flags: PageTableFlags
) -> Result<&'static mut [u8], AllocateError>
Allocate memory and map it to the given virtual address
sourcepub fn map_memory(
&mut self,
map_from: PhysAddr,
map_to: VirtAddr,
size: usize,
flags: PageTableFlags,
parent_flags: PageTableFlags
) -> Result<(), AllocateError>
pub fn map_memory(
&mut self,
map_from: PhysAddr,
map_to: VirtAddr,
size: usize,
flags: PageTableFlags,
parent_flags: PageTableFlags
) -> Result<(), AllocateError>
Map physical memory to the given virtual address
FIXME: change PhysAddr to ShimPhysAddr to ensure encrypted memory
sourcepub fn unmap_memory(
&mut self,
virt_addr: VirtAddr,
size: usize
) -> Result<(), UnmapError>
pub fn unmap_memory(
&mut self,
virt_addr: VirtAddr,
size: usize
) -> Result<(), UnmapError>
FIXME: unmap
sourcepub unsafe fn deallocate(&mut self, ptr: *mut u8, layout: Layout)
pub unsafe fn deallocate(&mut self, ptr: *mut u8, layout: Layout)
Trait Implementations
sourceimpl Debug for EnarxAllocator
impl Debug for EnarxAllocator
sourceimpl FrameAllocator<Size1GiB> for EnarxAllocator
impl FrameAllocator<Size1GiB> for EnarxAllocator
sourcefn allocate_frame(&mut self) -> Option<PhysFrame<Size1GiB>>
fn allocate_frame(&mut self) -> Option<PhysFrame<Size1GiB>>
Allocate a frame of the appropriate size and return it if possible.
sourceimpl FrameAllocator<Size2MiB> for EnarxAllocator
impl FrameAllocator<Size2MiB> for EnarxAllocator
sourcefn allocate_frame(&mut self) -> Option<PhysFrame<Size2MiB>>
fn allocate_frame(&mut self) -> Option<PhysFrame<Size2MiB>>
Allocate a frame of the appropriate size and return it if possible.
sourceimpl FrameAllocator<Size4KiB> for EnarxAllocator
impl FrameAllocator<Size4KiB> for EnarxAllocator
sourcefn allocate_frame(&mut self) -> Option<PhysFrame<Size4KiB>>
fn allocate_frame(&mut self) -> Option<PhysFrame<Size4KiB>>
Allocate a frame of the appropriate size and return it if possible.
Auto Trait Implementations
impl RefUnwindSafe for EnarxAllocator
impl Send for EnarxAllocator
impl !Sync for EnarxAllocator
impl Unpin for EnarxAllocator
impl UnwindSafe for EnarxAllocator
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more