diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-12-19 19:36:42 +0200 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2021-12-22 00:02:36 -0800 |
commit | 5f4a67434cdd1c9b85e925a8815130b585bd548c (patch) | |
tree | d9164c2814d8b38bacc557afcc942ccf03a193bf /Kernel/Memory | |
parent | fccd0432a13b17a85cea3dbd48ee7999159f31a9 (diff) | |
download | serenity-5f4a67434cdd1c9b85e925a8815130b585bd548c.zip |
Kernel: Move userspace virtual address range base to 0x10000
Now that the shared bottom 2 MiB virtual address mappings are gone
userspace can use lower virtual addresses.
Diffstat (limited to 'Kernel/Memory')
-rw-r--r-- | Kernel/Memory/PageDirectory.cpp | 2 | ||||
-rw-r--r-- | Kernel/Memory/Region.cpp | 2 | ||||
-rw-r--r-- | Kernel/Memory/Region.h | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/Memory/PageDirectory.cpp b/Kernel/Memory/PageDirectory.cpp index 0e922005f7..dda93a48db 100644 --- a/Kernel/Memory/PageDirectory.cpp +++ b/Kernel/Memory/PageDirectory.cpp @@ -44,7 +44,7 @@ UNMAP_AFTER_INIT NonnullRefPtr<PageDirectory> PageDirectory::must_create_kernel_ ErrorOr<NonnullRefPtr<PageDirectory>> PageDirectory::try_create_for_userspace(VirtualRangeAllocator const* parent_range_allocator) { - constexpr FlatPtr userspace_range_base = 0x00800000; + constexpr FlatPtr userspace_range_base = USER_RANGE_BASE; FlatPtr const userspace_range_ceiling = USER_RANGE_CEILING; auto directory = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) PageDirectory)); diff --git a/Kernel/Memory/Region.cpp b/Kernel/Memory/Region.cpp index 535a32d458..5132ec9835 100644 --- a/Kernel/Memory/Region.cpp +++ b/Kernel/Memory/Region.cpp @@ -179,7 +179,7 @@ bool Region::map_individual_page_impl(size_t page_index) VERIFY(m_page_directory->get_lock().is_locked_by_current_processor()); auto page_vaddr = vaddr_from_page_index(page_index); - bool user_allowed = page_vaddr.get() >= 0x00800000 && is_user_address(page_vaddr); + bool user_allowed = page_vaddr.get() >= USER_RANGE_BASE && is_user_address(page_vaddr); if (is_mmap() && !user_allowed) { PANIC("About to map mmap'ed page at a kernel address"); } diff --git a/Kernel/Memory/Region.h b/Kernel/Memory/Region.h index 403e9b743b..d93db7a969 100644 --- a/Kernel/Memory/Region.h +++ b/Kernel/Memory/Region.h @@ -89,7 +89,7 @@ public: void set_mmap(bool mmap) { m_mmap = mmap; } [[nodiscard]] bool is_user() const { return !is_kernel(); } - [[nodiscard]] bool is_kernel() const { return vaddr().get() < 0x00800000 || vaddr().get() >= kernel_mapping_base; } + [[nodiscard]] bool is_kernel() const { return vaddr().get() < USER_RANGE_BASE || vaddr().get() >= kernel_mapping_base; } PageFaultResponse handle_fault(PageFault const&); |