mirror of
https://github.com/rdmsr/zag.git
synced 2026-10-31 23:38:21 +00:00
ke+mm: add TLB shootdown and memory reclamation.
This commit is contained in:
+7
-1
@@ -16,8 +16,14 @@ pub fn alloc(size: usize) mm.Error!*anyopaque {
|
||||
mi.kernel_space.pmap.map_range_allocating(addr, size, .{
|
||||
.read = true,
|
||||
.write = true,
|
||||
.global = true,
|
||||
.global = false,
|
||||
});
|
||||
|
||||
return @ptrFromInt(addr);
|
||||
}
|
||||
|
||||
pub fn free(va: r.VAddr, size: usize) void {
|
||||
const ipl = mi.kernel_space.lock.acquire();
|
||||
mi.tlb.reclaim_range(&mi.kernel_space, va, size);
|
||||
mi.kernel_space.lock.release(ipl);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user