1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:47:44 +00:00

Kernel: Move page fault handling from MemoryManager to Region

After the page fault handler has found the region in which the fault
occurred, do the rest of the work in the region itself.

This patch also makes all fault types consistently crash the process
if a new page is needed but we're all out of pages.
This commit is contained in:
Andreas Kling 2019-11-04 00:45:33 +01:00
parent 0e8f1d7cb6
commit d67c6a92db
5 changed files with 163 additions and 153 deletions

View file

@ -23,11 +23,6 @@
class KBuffer;
class SynthFSInode;
enum class PageFaultResponse {
ShouldCrash,
Continue,
};
#define MM MemoryManager::the()
class MemoryManager {
@ -108,10 +103,6 @@ private:
static Region* region_from_vaddr(VirtualAddress);
bool copy_on_write(Region&, unsigned page_index_in_region);
bool page_in_from_inode(Region&, unsigned page_index_in_region);
bool zero_page(Region& region, unsigned page_index_in_region);
u8* quickmap_page(PhysicalPage&);
void unquickmap_page();