diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c index 453b0c72..e15d6adb 100644 --- a/arch/arm64/kernel/syscall.c +++ b/arch/arm64/kernel/syscall.c @@ -1707,7 +1707,7 @@ SYSCALL_DECLARE(mmap) | MAP_NONBLOCK // 0x10000 ; - const intptr_t addr0 = ihk_mc_syscall_arg0(ctx); + const uintptr_t addr0 = ihk_mc_syscall_arg0(ctx); const size_t len0 = ihk_mc_syscall_arg1(ctx); const int prot = ihk_mc_syscall_arg2(ctx); const int flags0 = ihk_mc_syscall_arg3(ctx); @@ -1716,7 +1716,7 @@ SYSCALL_DECLARE(mmap) struct thread *thread = cpu_local_var(current); struct vm_regions *region = &thread->vm->region; int error; - intptr_t addr = 0; + uintptr_t addr = 0; size_t len; int flags = flags0; size_t pgsize; diff --git a/arch/x86_64/kernel/syscall.c b/arch/x86_64/kernel/syscall.c index dd5f7721..230fa98c 100644 --- a/arch/x86_64/kernel/syscall.c +++ b/arch/x86_64/kernel/syscall.c @@ -1560,7 +1560,7 @@ SYSCALL_DECLARE(mmap) | MAP_NONBLOCK // 00010000 ; - const intptr_t addr0 = ihk_mc_syscall_arg0(ctx); + const uintptr_t addr0 = ihk_mc_syscall_arg0(ctx); const size_t len0 = ihk_mc_syscall_arg1(ctx); const int prot = ihk_mc_syscall_arg2(ctx); const int flags0 = ihk_mc_syscall_arg3(ctx); @@ -1569,7 +1569,7 @@ SYSCALL_DECLARE(mmap) struct thread *thread = cpu_local_var(current); struct vm_regions *region = &thread->vm->region; int error; - intptr_t addr = 0; + uintptr_t addr = 0; size_t len; int flags = flags0; size_t pgsize; diff --git a/kernel/include/syscall.h b/kernel/include/syscall.h index 158599e2..7ddef9b1 100644 --- a/kernel/include/syscall.h +++ b/kernel/include/syscall.h @@ -465,7 +465,7 @@ static inline unsigned long timespec_to_jiffy(const struct timespec *ats) void reset_cputime(void); void set_cputime(int mode); int do_munmap(void *addr, size_t len, int holding_memory_range_lock); -intptr_t do_mmap(intptr_t addr0, size_t len0, int prot, int flags, int fd, +intptr_t do_mmap(uintptr_t addr0, size_t len0, int prot, int flags, int fd, off_t off0); void clear_host_pte(uintptr_t addr, size_t len); typedef int32_t key_t; diff --git a/kernel/syscall.c b/kernel/syscall.c index 3608d279..aeb2b72f 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -1558,7 +1558,7 @@ int do_munmap(void *addr, size_t len, int holding_memory_range_lock) return error; } -static int search_free_space(size_t len, int pgshift, intptr_t *addrp) +static int search_free_space(size_t len, int pgshift, uintptr_t *addrp) { struct thread *thread = cpu_local_var(current); struct vm_regions *region = &thread->vm->region; @@ -1600,12 +1600,12 @@ out: } intptr_t -do_mmap(const intptr_t addr0, const size_t len0, const int prot, +do_mmap(const uintptr_t addr0, const size_t len0, const int prot, const int flags, const int fd, const off_t off0) { struct thread *thread = cpu_local_var(current); struct vm_regions *region = &thread->vm->region; - intptr_t addr = addr0; + uintptr_t addr = addr0; size_t len = len0; size_t populate_len = 0; off_t off; @@ -5229,7 +5229,7 @@ SYSCALL_DECLARE(shmat) struct process_vm *vm = thread->vm; size_t len; int error; - intptr_t addr; + uintptr_t addr; int prot; int vrflags; int req; @@ -8105,8 +8105,7 @@ SYSCALL_DECLARE(mremap) goto out; } need_relocate = 1; - error = search_free_space(newsize, range->pgshift, - (intptr_t *)&newstart); + error = search_free_space(newsize, range->pgshift, &newstart); if (error) { ekprintf("sys_mremap(%#lx,%#lx,%#lx,%#x,%#lx):" "search failed. %d\n",