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

@@ -301,6 +301,13 @@ namespace Kernel
return BAN::UniqPtr<MemoryRegion>(BAN::move(region));
}
BAN::ErrorOr<BAN::UniqPtr<MemoryRegion>> split(size_t offset) override
{
(void)offset;
dwarnln("TODO: FramebufferMemoryRegion::split");
return BAN::Error::from_errno(ENOTSUP);
}
protected:
// Returns error if no memory was available
// Returns true if page was succesfully allocated