#[repr(align(64))]pub struct Mm {
hhdm_offset: AtomicU64,
pmm: UncheckedCell<IrqMutex<Pmm>>,
kernel_addr_space: UncheckedCell<IrqMutex<AddressSpace>>,
next_kernel_stack: AtomicU64,
}Expand description
Holds memory management state such as slab allocators and virtual memory areas
Fields§
§hhdm_offset: AtomicU64§pmm: UncheckedCell<IrqMutex<Pmm>>§kernel_addr_space: UncheckedCell<IrqMutex<AddressSpace>>§next_kernel_stack: AtomicU64Implementations§
Source§impl Mm
impl Mm
Sourcepub fn set_hhdm_offset(&self, offset: u64)
pub fn set_hhdm_offset(&self, offset: u64)
Sets the HHDM offset
Sourcepub unsafe fn init_pmm(&self, pmm: Pmm)
pub unsafe fn init_pmm(&self, pmm: Pmm)
Move the given Pmm into Mm::pmm
§Safety
The caller must guarantee the following:
- That this method has never been called before and will never be called again
- That at the time of calling this method, no references or pointers to this data exist
- While this method is being called, no other CPU is working with the given data
Sourcepub unsafe fn init_kernel_addr_space(&self, kernel_addr_space: AddressSpace)
pub unsafe fn init_kernel_addr_space(&self, kernel_addr_space: AddressSpace)
Move the given AddressSpace into Mm::kernel_addr_space
§Safety
The caller must guarantee the following:
- That this method has never been called before and will never be called again
- That at the time of calling this method, no references or pointers to this data exist
- While this method is being called, no other CPU is working with the given data
Sourcepub fn hhdm_offset(&self) -> u64
pub fn hhdm_offset(&self) -> u64
Getter for the hhdm offset
Sourcepub unsafe fn pmm(&self) -> &IrqMutex<Pmm>
pub unsafe fn pmm(&self) -> &IrqMutex<Pmm>
Getter for Mm::pmm
§Safety
The caller must guarantee the following:
- That this value’s
initmethod has already been called before - That at this method’s entire execution time, no mutable references or pointers to this data exist or will exist
Sourcepub unsafe fn kernel_addr_space(&self) -> &IrqMutex<AddressSpace>
pub unsafe fn kernel_addr_space(&self) -> &IrqMutex<AddressSpace>
Getter for Mm::kernel_address_space
§Safety
The caller must guarantee the following:
- That this value’s
initmethod has already been called before - That at this method’s entire execution time, no mutable references or pointers to this data exist or will exist
Sourcepub fn alloc_kernel_stack_slot(&self) -> VirtAddr
pub fn alloc_kernel_stack_slot(&self) -> VirtAddr
Get the starting address of the next kernel stack and increment it