reclaiming uefi memory

This commit is contained in:
2026-07-03 19:31:32 +01:00
parent 50f3610768
commit 21b9691486
6 changed files with 79 additions and 48 deletions
+6 -5
View File
@@ -41,13 +41,14 @@ pub const page_size = 4096;
/// native memory description into these kinds, so the kernel never learns what
/// booted it. [[arch]] keeps the same discipline for CPU code.
pub const MemoryKind = enum(u32) {
/// Free RAM the kernel may allocate.
/// Free RAM the kernel may allocate. Each boot path folds its own transient
/// memory into this once it's genuinely free (e.g. the UEFI loader classifies
/// boot-services memory as usable after ExitBootServices), so the kernel never
/// has to know about boot-protocol-specific "reclaimable" states.
usable,
/// Firmware, MMIO, the kernel image, our own boot buffers — never hand out.
/// Firmware, MMIO, the kernel image, our own boot buffers, the boot stack —
/// never hand out.
reserved,
/// Usable once the kernel is done with boot-time structures (e.g. UEFI boot
/// services memory, which is free after ExitBootServices).
reclaimable,
/// ACPI tables: parse, then reclaim.
acpi_tables,
/// ACPI non-volatile storage: preserve across sleep, do not allocate.