feat(mm): add allocators

This commit is contained in:
Loïc Grégoire
2026-04-10 18:04:34 -04:00
parent c6fa2a8c48
commit 748854577e
9 changed files with 1252 additions and 4 deletions
+3
View File
@@ -6,6 +6,7 @@ const std = @import("std");
pub const page_size = 4096;
pub const init = private.init.init;
pub const vmem = private.vmem;
// 16 TB of maximum physical memory.
// This should be fine on consumer hardware for at least a decade :^)
@@ -28,6 +29,8 @@ pub const MapFlags = packed struct {
cache_disable: bool = false,
};
pub const Error = error{OutOfMemory, InvalidAddress, InvalidSize};
pub inline fn page_to_pfn(addr: usize) Pfn {
return @intCast(addr >> 12);
}