feat(domain): add memory module with page pool, per-process tracking, and region table
This commit is contained in:
@@ -7,6 +7,23 @@ pub struct StackPointer(usize);
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct VirtualAddress(usize);
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct PhysicalAddress(usize);
|
||||
|
||||
impl PhysicalAddress {
|
||||
pub fn from_raw(addr: usize) -> Self {
|
||||
Self(addr)
|
||||
}
|
||||
|
||||
pub fn raw(&self) -> usize {
|
||||
self.0
|
||||
}
|
||||
|
||||
pub fn offset(&self, pages: usize) -> Self {
|
||||
Self(self.0 + pages * 4096)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct DataRef {
|
||||
addr: VirtualAddress,
|
||||
|
||||
Reference in New Issue
Block a user