summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Kernel/API/Syscall.h4
-rw-r--r--Kernel/Syscalls/mmap.cpp2
-rw-r--r--Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp4
-rw-r--r--Userland/Libraries/LibC/sys/mman.cpp4
-rw-r--r--Userland/Libraries/LibCore/System.cpp2
5 files changed, 8 insertions, 8 deletions
diff --git a/Kernel/API/Syscall.h b/Kernel/API/Syscall.h
index 5a6b793eee..6167244b6e 100644
--- a/Kernel/API/Syscall.h
+++ b/Kernel/API/Syscall.h
@@ -239,7 +239,7 @@ struct StringListArgument {
};
struct SC_mmap_params {
- uintptr_t addr;
+ void* addr;
size_t size;
size_t alignment;
int32_t prot;
@@ -250,7 +250,7 @@ struct SC_mmap_params {
};
struct SC_mremap_params {
- uintptr_t old_address;
+ void* old_address;
size_t old_size;
size_t new_size;
int32_t flags;
diff --git a/Kernel/Syscalls/mmap.cpp b/Kernel/Syscalls/mmap.cpp
index a1bcad7ee3..f67e83d2b3 100644
--- a/Kernel/Syscalls/mmap.cpp
+++ b/Kernel/Syscalls/mmap.cpp
@@ -123,7 +123,7 @@ ErrorOr<FlatPtr> Process::sys$mmap(Userspace<const Syscall::SC_mmap_params*> use
REQUIRE_PROMISE(stdio);
auto params = TRY(copy_typed_from_user(user_params));
- FlatPtr addr = params.addr;
+ auto addr = (FlatPtr)params.addr;
auto size = params.size;
auto alignment = params.alignment ? params.alignment : PAGE_SIZE;
auto prot = params.prot;
diff --git a/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp b/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
index 07ca7dade8..704127175a 100644
--- a/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
+++ b/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
@@ -877,7 +877,7 @@ u32 Emulator::virt$mmap(u32 params_addr)
if (params.addr) {
// If MAP_FIXED is specified, existing mappings that intersect the requested range are removed.
if (params.flags & MAP_FIXED)
- virt$munmap(params.addr, requested_size);
+ virt$munmap((FlatPtr)params.addr, requested_size);
result = m_range_allocator.allocate_specific(VirtualAddress { params.addr }, requested_size);
} else {
// mmap(nullptr, …, MAP_FIXED) is technically okay, but tends to be a bug.
@@ -926,7 +926,7 @@ FlatPtr Emulator::virt$mremap(FlatPtr params_addr)
mmu().copy_from_vm(&params, params_addr, sizeof(params));
// FIXME: Support regions that have been split in the past (e.g. due to mprotect or munmap).
- if (auto* region = mmu().find_region({ m_cpu.ds(), params.old_address })) {
+ if (auto* region = mmu().find_region({ m_cpu.ds(), (FlatPtr)params.old_address })) {
if (!is<MmapRegion>(*region))
return -EINVAL;
VERIFY(region->size() == params.old_size);
diff --git a/Userland/Libraries/LibC/sys/mman.cpp b/Userland/Libraries/LibC/sys/mman.cpp
index 7982da44b3..ff40f87e17 100644
--- a/Userland/Libraries/LibC/sys/mman.cpp
+++ b/Userland/Libraries/LibC/sys/mman.cpp
@@ -15,7 +15,7 @@ extern "C" {
void* serenity_mmap(void* addr, size_t size, int prot, int flags, int fd, off_t offset, size_t alignment, const char* name)
{
- Syscall::SC_mmap_params params { (uintptr_t)addr, size, alignment, prot, flags, fd, offset, { name, name ? strlen(name) : 0 } };
+ Syscall::SC_mmap_params params { addr, size, alignment, prot, flags, fd, offset, { name, name ? strlen(name) : 0 } };
ptrdiff_t rc = syscall(SC_mmap, &params);
if (rc < 0 && rc > -EMAXERRNO) {
errno = -rc;
@@ -37,7 +37,7 @@ void* mmap_with_name(void* addr, size_t size, int prot, int flags, int fd, off_t
void* mremap(void* old_address, size_t old_size, size_t new_size, int flags)
{
- Syscall::SC_mremap_params params { (uintptr_t)old_address, old_size, new_size, flags };
+ Syscall::SC_mremap_params params { old_address, old_size, new_size, flags };
ptrdiff_t rc = syscall(SC_mremap, &params);
if (rc < 0 && rc > -EMAXERRNO) {
errno = -rc;
diff --git a/Userland/Libraries/LibCore/System.cpp b/Userland/Libraries/LibCore/System.cpp
index aa8d2ac075..8c582a8a29 100644
--- a/Userland/Libraries/LibCore/System.cpp
+++ b/Userland/Libraries/LibCore/System.cpp
@@ -151,7 +151,7 @@ ErrorOr<int> fcntl(int fd, int command, ...)
ErrorOr<void*> mmap(void* address, size_t size, int protection, int flags, int fd, off_t offset, [[maybe_unused]] size_t alignment, [[maybe_unused]] StringView name)
{
#ifdef __serenity__
- Syscall::SC_mmap_params params { (uintptr_t)address, size, alignment, protection, flags, fd, offset, { name.characters_without_null_termination(), name.length() } };
+ Syscall::SC_mmap_params params { address, size, alignment, protection, flags, fd, offset, { name.characters_without_null_termination(), name.length() } };
ptrdiff_t rc = syscall(SC_mmap, &params);
if (rc < 0 && rc > -EMAXERRNO)
return Error::from_syscall("mmap"sv, rc);