diff options
author | Andreas Kling <kling@serenityos.org> | 2020-07-30 23:52:28 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-30 23:52:28 +0200 |
commit | be7add690d3caa622ca2fdba96a00f4127229648 (patch) | |
tree | 050f6d72047d9fa4644c921f36b664dfeff8b2d9 /Kernel/Syscalls | |
parent | 2e2de125e5134d0fdcb6d4e96a3a025be5630811 (diff) | |
download | serenity-be7add690d3caa622ca2fdba96a00f4127229648.zip |
Kernel: Rename region_from_foo() => find_region_from_foo()
Let's emphasize that these functions actually go out and find regions.
Diffstat (limited to 'Kernel/Syscalls')
-rw-r--r-- | Kernel/Syscalls/get_stack_bounds.cpp | 2 | ||||
-rw-r--r-- | Kernel/Syscalls/mmap.cpp | 14 | ||||
-rw-r--r-- | Kernel/Syscalls/ptrace.cpp | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/Kernel/Syscalls/get_stack_bounds.cpp b/Kernel/Syscalls/get_stack_bounds.cpp index d3d089b423..e41bcb5ddb 100644 --- a/Kernel/Syscalls/get_stack_bounds.cpp +++ b/Kernel/Syscalls/get_stack_bounds.cpp @@ -37,7 +37,7 @@ int Process::sys$get_stack_bounds(FlatPtr* user_stack_base, size_t* user_stack_s return -EFAULT; FlatPtr stack_pointer = Thread::current()->get_register_dump_from_stack().userspace_esp; - auto* stack_region = MM.region_from_vaddr(*this, VirtualAddress(stack_pointer)); + auto* stack_region = MM.find_region_from_vaddr(*this, VirtualAddress(stack_pointer)); if (!stack_region) { ASSERT_NOT_REACHED(); return -EINVAL; diff --git a/Kernel/Syscalls/mmap.cpp b/Kernel/Syscalls/mmap.cpp index 8bddb36e72..416a9694b6 100644 --- a/Kernel/Syscalls/mmap.cpp +++ b/Kernel/Syscalls/mmap.cpp @@ -203,7 +203,7 @@ int Process::sys$mprotect(void* addr, size_t size, int prot) Range range_to_mprotect = { VirtualAddress(addr), size }; - if (auto* whole_region = region_from_range(range_to_mprotect)) { + if (auto* whole_region = find_region_from_range(range_to_mprotect)) { if (!whole_region->is_mmap()) return -EPERM; if (!validate_mmap_prot(prot, whole_region->is_stack())) @@ -222,7 +222,7 @@ int Process::sys$mprotect(void* addr, size_t size, int prot) } // Check if we can carve out the desired range from an existing region - if (auto* old_region = region_containing(range_to_mprotect)) { + if (auto* old_region = find_region_containing(range_to_mprotect)) { if (!old_region->is_mmap()) return -EPERM; if (!validate_mmap_prot(prot, old_region->is_stack())) @@ -271,7 +271,7 @@ int Process::sys$madvise(void* address, size_t size, int advice) if (!is_user_range(VirtualAddress(address), size)) return -EFAULT; - auto* region = region_from_range({ VirtualAddress(address), size }); + auto* region = find_region_from_range({ VirtualAddress(address), size }); if (!region) return -EINVAL; if (!region->is_mmap()) @@ -309,7 +309,7 @@ int Process::sys$minherit(void* address, size_t size, int inherit) { REQUIRE_PROMISE(stdio); - auto* region = region_from_range({ VirtualAddress(address), size }); + auto* region = find_region_from_range({ VirtualAddress(address), size }); if (!region) return -EINVAL; @@ -346,7 +346,7 @@ int Process::sys$set_mmap_name(const Syscall::SC_set_mmap_name_params* user_para if (name.is_null()) return -EFAULT; - auto* region = region_from_range({ VirtualAddress(params.addr), params.size }); + auto* region = find_region_from_range({ VirtualAddress(params.addr), params.size }); if (!region) return -EINVAL; if (!region->is_mmap()) @@ -384,7 +384,7 @@ int Process::sys$munmap(void* addr, size_t size) return -EFAULT; Range range_to_unmap { VirtualAddress(addr), size }; - if (auto* whole_region = region_from_range(range_to_unmap)) { + if (auto* whole_region = find_region_from_range(range_to_unmap)) { if (!whole_region->is_mmap()) return -EPERM; bool success = deallocate_region(*whole_region); @@ -392,7 +392,7 @@ int Process::sys$munmap(void* addr, size_t size) return 0; } - if (auto* old_region = region_containing(range_to_unmap)) { + if (auto* old_region = find_region_containing(range_to_unmap)) { if (!old_region->is_mmap()) return -EPERM; diff --git a/Kernel/Syscalls/ptrace.cpp b/Kernel/Syscalls/ptrace.cpp index c5953070cc..35465af5f1 100644 --- a/Kernel/Syscalls/ptrace.cpp +++ b/Kernel/Syscalls/ptrace.cpp @@ -84,7 +84,7 @@ KResult Process::poke_user_data(u32* address, u32 data) } ProcessPagingScope scope(*this); Range range = { VirtualAddress(address), sizeof(u32) }; - auto* region = region_containing(range); + auto* region = find_region_containing(range); ASSERT(region != nullptr); if (region->is_shared()) { // If the region is shared, we change its vmobject to a PrivateInodeVMObject |