|
contur2
|
Abstract interface for the Memory Management Unit. More...
#include <i_mmu.h>

Public Member Functions | |
| virtual | ~IMMU ()=default |
| virtual Result< Block > | read (ProcessId processId, MemoryAddress virtualAddress) const =0 |
| Reads a Block from a virtual address in a given process's address space. | |
| virtual Result< void > | write (ProcessId processId, MemoryAddress virtualAddress, const Block &block)=0 |
| Writes a Block to a virtual address in a given process's address space. | |
| virtual Result< MemoryAddress > | allocate (ProcessId processId, std::size_t pageCount)=0 |
| Allocates a range of frames for a process. | |
| virtual Result< void > | deallocate (ProcessId processId)=0 |
| Deallocates all frames owned by a process. | |
| virtual Result< void > | swapIn (ProcessId processId, MemoryAddress virtualAddress)=0 |
| Swaps a page into physical memory. | |
| virtual Result< void > | swapOut (ProcessId processId, MemoryAddress virtualAddress)=0 |
| Swaps a page out of physical memory (to simulated disk). | |
| virtual std::size_t | totalFrames () const noexcept=0 |
| Returns the total number of physical frames managed. | |
| virtual std::size_t | freeFrames () const noexcept=0 |
| Returns the number of free (unallocated) physical frames. | |
Abstract interface for the Memory Management Unit.
Translates virtual addresses to physical addresses via page tables, manages frame allocation, and handles page swapping (swap in/out). The MMU sits between the CPU and physical memory, providing virtual memory support for process isolation.
|
virtualdefault |
|
nodiscardpure virtual |
Allocates a range of frames for a process.
| processId | The owning process. |
| pageCount | Number of pages (frames) to allocate. |
Implemented in contur::Mmu.
Deallocates all frames owned by a process.
| processId | The process whose frames should be freed. |
Implemented in contur::Mmu.
|
nodiscardpure virtualnoexcept |
Returns the number of free (unallocated) physical frames.
Implemented in contur::Mmu.
|
nodiscardpure virtual |
Reads a Block from a virtual address in a given process's address space.
| processId | The owning process. |
| virtualAddress | The virtual address to read from. |
Implemented in contur::Mmu.
|
nodiscardpure virtual |
Swaps a page into physical memory.
| processId | The owning process. |
| virtualAddress | A virtual address within the target page. |
Implemented in contur::Mmu.
|
nodiscardpure virtual |
Swaps a page out of physical memory (to simulated disk).
| processId | The owning process. |
| virtualAddress | A virtual address within the target page. |
Implemented in contur::Mmu.
|
nodiscardpure virtualnoexcept |
Returns the total number of physical frames managed.
Implemented in contur::Mmu.
|
nodiscardpure virtual |
Writes a Block to a virtual address in a given process's address space.
| processId | The owning process. |
| virtualAddress | The virtual address to write to. |
| block | The Block to store. |
Implemented in contur::Mmu.