From 6ed9cc47174728cfdc5134bd41744e8ecf8eacdc Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 4 Nov 2019 00:23:31 +0100 Subject: Kernel: Remove Region API's for setting/unsetting the page directory This is done implicitly by mapping or unmapping the region. --- Kernel/VM/Region.cpp | 5 +++-- Kernel/VM/Region.h | 12 ------------ 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); -- cgit v1.2.3