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§
Source§impl 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§
Source§impl Debug for EnarxAllocator
impl Debug for EnarxAllocator
Source§impl FrameAllocator<Size1GiB> for EnarxAllocator
impl FrameAllocator<Size1GiB> for EnarxAllocator
Source§impl FrameAllocator<Size2MiB> for EnarxAllocator
impl FrameAllocator<Size2MiB> for EnarxAllocator
Source§impl FrameAllocator<Size4KiB> for EnarxAllocator
impl FrameAllocator<Size4KiB> for EnarxAllocator
Auto Trait Implementations§
impl Freeze for EnarxAllocator
impl RefUnwindSafe for EnarxAllocator
impl Send for EnarxAllocator
impl !Sync for EnarxAllocator
impl Unpin for EnarxAllocator
impl UnwindSafe for EnarxAllocator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more