summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-11-04 00:23:31 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-11-04 00:24:20 +0100
commit6ed9cc47174728cfdc5134bd41744e8ecf8eacdc (patch)
tree019748813424f75c18d524897326cab8cbf03355
parente3dda4e87b39eb142d85dd520af3c772b793a2fb (diff)
downloadserenity-6ed9cc47174728cfdc5134bd41744e8ecf8eacdc.zip
Kernel: Remove Region API's for setting/unsetting the page directory
This is done implicitly by mapping or unmapping the region.
-rw-r--r--Kernel/VM/Region.cpp5
-rw-r--r--Kernel/VM/Region.h12
2 files changed, 3 insertions, 14 deletions
diff --git a/Kernel/VM/Region.cpp b/Kernel/VM/Region.cpp
index bb2173cf73..2e05dba93b 100644
--- a/Kernel/VM/Region.cpp
+++ b/Kernel/VM/Region.cpp
@@ -213,13 +213,14 @@ void Region::unmap(ShouldDeallocateVirtualMemoryRange deallocate_range)
}
if (deallocate_range == ShouldDeallocateVirtualMemoryRange::Yes)
page_directory()->range_allocator().deallocate(range());
- release_page_directory();
+ m_page_directory = nullptr;
}
void Region::map(PageDirectory& page_directory)
{
+ ASSERT(!m_page_directory || m_page_directory == &page_directory);
InterruptDisabler disabler;
- set_page_directory(page_directory);
+ m_page_directory = page_directory;
#ifdef MM_DEBUG
dbgprintf("MM: map_region_at_address will map VMO pages %u - %u (VMO page count: %u)\n", first_page_index(), last_page_index(), vmobject().page_count());
#endif
diff --git a/Kernel/VM/Region.h b/Kernel/VM/Region.h
index 1d9ce7f5d3..5a3b7ca4ad 100644
--- a/Kernel/VM/Region.h
+++ b/Kernel/VM/Region.h
@@ -91,18 +91,6 @@ public:
PageDirectory* page_directory() { return m_page_directory.ptr(); }
- void set_page_directory(PageDirectory& page_directory)
- {
- ASSERT(!m_page_directory || m_page_directory == &page_directory);
- m_page_directory = page_directory;
- }
-
- void release_page_directory()
- {
- ASSERT(m_page_directory);
- m_page_directory.clear();
- }
-
bool should_cow(size_t page_index) const;
void set_should_cow(size_t page_index, bool);