diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-06-13 21:42:12 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-06-13 21:42:12 +0200 |
commit | 1c5677032a948073a91078e57d4d7d4ae4712d36 (patch) | |
tree | c074c009af4bab29bb46d8cd95ee09bc9862d734 | |
parent | 42f374d0f11dc0509f22411f59adb0af1b6db27e (diff) | |
download | serenity-1c5677032a948073a91078e57d4d7d4ae4712d36.zip |
Kernel: Replace the last "linear" with "virtual".
-rw-r--r-- | Kernel/VM/MemoryManager.cpp | 4 | ||||
-rw-r--r-- | Kernel/VirtualAddress.h | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Kernel/VM/MemoryManager.cpp b/Kernel/VM/MemoryManager.cpp index aa3292fdb1..3f1fd93753 100644 --- a/Kernel/VM/MemoryManager.cpp +++ b/Kernel/VM/MemoryManager.cpp @@ -74,7 +74,7 @@ void MemoryManager::initialize_paging() // 3 MB -> 4 MB kmalloc() space. // 4 MB -> 5 MB Supervisor physical pages (available for allocation!) // 5 MB -> 0xc0000000 Userspace physical pages (available for allocation!) - // 0xc0000000-0xffffffff Kernel-only linear address space + // 0xc0000000-0xffffffff Kernel-only virtual address space #ifdef MM_DEBUG dbgprintf("MM: Quickmap will use %p\n", m_quickmap_addr.get()); @@ -225,7 +225,7 @@ auto MemoryManager::ensure_pte(PageDirectory& page_directory, VirtualAddress vad void MemoryManager::map_protected(VirtualAddress vaddr, size_t length) { InterruptDisabler disabler; - // FIXME: ASSERT(linearAddress is 4KB aligned); + ASSERT(vaddr.is_page_aligned()); for (dword offset = 0; offset < length; offset += PAGE_SIZE) { auto pte_address = vaddr.offset(offset); auto pte = ensure_pte(kernel_page_directory(), pte_address); diff --git a/Kernel/VirtualAddress.h b/Kernel/VirtualAddress.h index 423987e474..5f9e7d546b 100644 --- a/Kernel/VirtualAddress.h +++ b/Kernel/VirtualAddress.h @@ -11,6 +11,7 @@ public: } bool is_null() const { return m_address == 0; } + bool is_page_aligned() const { return (m_address & 0xfff) == 0; } VirtualAddress offset(dword o) const { return VirtualAddress(m_address + o); } dword get() const { return m_address; } |