Kernel: Implement proper memory region splitting

Memory regions are now splitted when they get munmapped, mprotected, or
mmapped with MAP_FIXED. This is used by couple of ports, and without
this we were just leaking up memory or straight up crashing programs.
This commit is contained in:
2025-11-10 19:57:26 +02:00
parent a39aa73e21
commit 9537922acc
10 changed files with 145 additions and 46 deletions

View File

@@ -15,6 +15,7 @@ namespace Kernel
~MemoryBackedRegion();
BAN::ErrorOr<BAN::UniqPtr<MemoryRegion>> clone(PageTable& new_page_table) override;
BAN::ErrorOr<BAN::UniqPtr<MemoryRegion>> split(size_t offset) override;
BAN::ErrorOr<void> msync(vaddr_t, size_t, int) override { return {}; }