⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

ProcessMemory

Trait ProcessMemory 

Source
pub trait ProcessMemory {
    // Required methods
    fn allocate(
        &mut self,
        size: usize,
        flags: PageFlags,
    ) -> Result<VirtualAddress, KernelError>;
    fn free(
        &mut self,
        addr: VirtualAddress,
        size: usize,
    ) -> Result<(), KernelError>;
    fn map_physical(
        &mut self,
        phys: PhysicalAddress,
        virt: VirtualAddress,
        size: usize,
        flags: PageFlags,
    ) -> Result<(), KernelError>;
    fn unmap(
        &mut self,
        virt: VirtualAddress,
        size: usize,
    ) -> Result<(), KernelError>;
    fn protect(
        &mut self,
        addr: VirtualAddress,
        size: usize,
        flags: PageFlags,
    ) -> Result<(), KernelError>;
    fn grow_heap(
        &mut self,
        increment: usize,
    ) -> Result<VirtualAddress, KernelError>;
    fn grow_stack(&mut self, increment: usize) -> Result<(), KernelError>;
}
Expand description

Process memory operations

Required Methods§

Source

fn allocate( &mut self, size: usize, flags: PageFlags, ) -> Result<VirtualAddress, KernelError>

Allocate memory in process address space

Source

fn free(&mut self, addr: VirtualAddress, size: usize) -> Result<(), KernelError>

Free memory in process address space

Source

fn map_physical( &mut self, phys: PhysicalAddress, virt: VirtualAddress, size: usize, flags: PageFlags, ) -> Result<(), KernelError>

Map physical memory into process address space

Source

fn unmap( &mut self, virt: VirtualAddress, size: usize, ) -> Result<(), KernelError>

Unmap memory from process address space

Source

fn protect( &mut self, addr: VirtualAddress, size: usize, flags: PageFlags, ) -> Result<(), KernelError>

Change memory protection

Source

fn grow_heap(&mut self, increment: usize) -> Result<VirtualAddress, KernelError>

Grow the heap

Source

fn grow_stack(&mut self, increment: usize) -> Result<(), KernelError>

Grow the stack

Implementors§