1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:37:35 +00:00

Kernel: Track user accessibility per Region.

Region now has is_user_accessible(), which informs the memory manager how
to map these pages. Previously, we were just passing a "bool user_allowed"
to various functions and I'm not at all sure that any of that was correct.

All the Region constructors are now hidden, and you must go through one of
these helpers to construct a region:

- Region::create_user_accessible(...)
- Region::create_kernel_only(...)

That ensures that we don't accidentally create a Region without specifying
user accessibility. :^)
This commit is contained in:
Andreas Kling 2019-07-19 16:09:34 +02:00
parent 4547a301c4
commit 5b2447a27b
6 changed files with 73 additions and 30 deletions

View file

@ -71,7 +71,7 @@ public:
void map_for_kernel(VirtualAddress, PhysicalAddress);
RefPtr<Region> allocate_kernel_region(size_t, String&& name);
void map_region_at_address(PageDirectory&, Region&, VirtualAddress, bool user_accessible);
void map_region_at_address(PageDirectory&, Region&, VirtualAddress);
unsigned user_physical_pages() const { return m_user_physical_pages; }
unsigned user_physical_pages_used() const { return m_user_physical_pages_used; }
@ -87,7 +87,7 @@ private:
void register_region(Region&);
void unregister_region(Region&);
void remap_region_page(Region&, unsigned page_index_in_region, bool user_allowed);
void remap_region_page(Region&, unsigned page_index_in_region);
void initialize_paging();
void flush_entire_tlb();