summaryrefslogtreecommitdiff
path: root/Kernel/VM/MemoryManager.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-02-08 15:25:12 +0100
committerAndreas Kling <kling@serenityos.org>2021-02-08 18:27:28 +0100
commitb2cba3036ef83d4099d917124ad65efc955a2f68 (patch)
tree13b9f65092cd47bccadab7fe179aba6109380258 /Kernel/VM/MemoryManager.cpp
parentcf5ab665e00033bf86b327eec31a3f495372801d (diff)
downloadserenity-b2cba3036ef83d4099d917124ad65efc955a2f68.zip
Kernel: Remove unused MemoryManager::validate_range()
This is no longer used since we've switched to using the MMU to generate EFAULT errors.
Diffstat (limited to 'Kernel/VM/MemoryManager.cpp')
-rw-r--r--Kernel/VM/MemoryManager.cpp35
1 files changed, 0 insertions, 35 deletions
diff --git a/Kernel/VM/MemoryManager.cpp b/Kernel/VM/MemoryManager.cpp
index 20e5a4d46c..3ee5f39671 100644
--- a/Kernel/VM/MemoryManager.cpp
+++ b/Kernel/VM/MemoryManager.cpp
@@ -841,41 +841,6 @@ void MemoryManager::unquickmap_page()
mm_data.m_quickmap_in_use.unlock(mm_data.m_quickmap_prev_flags);
}
-template<MemoryManager::AccessSpace space, MemoryManager::AccessType access_type>
-bool MemoryManager::validate_range(const Process& process, VirtualAddress base_vaddr, size_t size) const
-{
- ASSERT(s_mm_lock.is_locked());
- ASSERT(size);
- if (base_vaddr > base_vaddr.offset(size)) {
- dbgln("Shenanigans! Asked to validate wrappy {} size={}", base_vaddr, size);
- return false;
- }
-
- VirtualAddress vaddr = base_vaddr.page_base();
- VirtualAddress end_vaddr = base_vaddr.offset(size - 1).page_base();
- if (end_vaddr < vaddr) {
- dbgln("Shenanigans! Asked to validate {} size={}", base_vaddr, size);
- return false;
- }
- const Region* region = nullptr;
- while (vaddr <= end_vaddr) {
- if (!region || !region->contains(vaddr)) {
- if (space == AccessSpace::Kernel)
- region = kernel_region_from_vaddr(vaddr);
- if (!region || !region->contains(vaddr))
- region = user_region_from_vaddr(const_cast<Process&>(process), vaddr);
- if (!region
- || (space == AccessSpace::User && !region->is_user_accessible())
- || (access_type == AccessType::Read && !region->is_readable())
- || (access_type == AccessType::Write && !region->is_writable())) {
- return false;
- }
- }
- vaddr = region->range().end();
- }
- return true;
-}
-
bool MemoryManager::validate_user_stack(const Process& process, VirtualAddress vaddr) const
{
if (!is_user_address(vaddr))