diff options
author | Andreas Kling <kling@serenityos.org> | 2021-02-14 01:25:22 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-14 01:34:23 +0100 |
commit | 8415866c0371eae16e3c1221720efaa6c3cec3e2 (patch) | |
tree | 069ac36c07e125f946a1369eb34746e427ba3eb0 /Kernel/VM/Space.cpp | |
parent | 1593219a41bdb9d8efa62abf5fca462b38563878 (diff) | |
download | serenity-8415866c0371eae16e3c1221720efaa6c3cec3e2.zip |
Kernel: Remove user/kernel flags from Region
Now that we no longer need to support the signal trampolines being
user-accessible inside the kernel memory range, we can get rid of the
"kernel" and "user-accessible" flags on Region and simply use the
address of the region to determine whether it's kernel or user.
This also tightens the page table mapping code, since it can now set
user-accessibility based solely on the virtual address of a page.
Diffstat (limited to 'Kernel/VM/Space.cpp')
-rw-r--r-- | Kernel/VM/Space.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/VM/Space.cpp b/Kernel/VM/Space.cpp index 9bb77f9173..5cb7e28d2e 100644 --- a/Kernel/VM/Space.cpp +++ b/Kernel/VM/Space.cpp @@ -66,7 +66,7 @@ Optional<Range> Space::allocate_range(VirtualAddress vaddr, size_t size, size_t Region& Space::allocate_split_region(const Region& source_region, const Range& range, size_t offset_in_vmobject) { auto& region = add_region(Region::create_user_accessible( - m_process, range, source_region.vmobject(), offset_in_vmobject, source_region.name(), source_region.access(), source_region.is_cacheable(), source_region.is_shared())); + m_process, range, source_region.vmobject(), offset_in_vmobject, source_region.name(), source_region.access(), source_region.is_cacheable() ? Region::Cacheable::Yes : Region::Cacheable::No, source_region.is_shared())); region.set_syscall_region(source_region.is_syscall_region()); region.set_mmap(source_region.is_mmap()); region.set_stack(source_region.is_stack()); @@ -84,7 +84,7 @@ KResultOr<Region*> Space::allocate_region(const Range& range, const String& name auto vmobject = AnonymousVMObject::create_with_size(range.size(), strategy); if (!vmobject) return ENOMEM; - auto region = Region::create_user_accessible(m_process, range, vmobject.release_nonnull(), 0, name, prot_to_region_access_flags(prot), true, false); + auto region = Region::create_user_accessible(m_process, range, vmobject.release_nonnull(), 0, name, prot_to_region_access_flags(prot), Region::Cacheable::Yes, false); if (!region->map(page_directory())) return ENOMEM; return &add_region(move(region)); @@ -107,7 +107,7 @@ KResultOr<Region*> Space::allocate_region_with_vmobject(const Range& range, Nonn return EINVAL; } offset_in_vmobject &= PAGE_MASK; - auto& region = add_region(Region::create_user_accessible(m_process, range, move(vmobject), offset_in_vmobject, name, prot_to_region_access_flags(prot), true, shared)); + auto& region = add_region(Region::create_user_accessible(m_process, range, move(vmobject), offset_in_vmobject, name, prot_to_region_access_flags(prot), Region::Cacheable::Yes, shared)); if (!region.map(page_directory())) { // FIXME: What is an appropriate error code here, really? return ENOMEM; |