do_mmap: change addr to uintptr_t

Change-Id: I7df45e125387083aef7e62b046c20b7422f60f22
This commit is contained in:
Dominique Martinet
2018-09-20 13:08:58 +09:00
committed by Masamichi Takagi
parent c86d168165
commit 01fe83dcb3
4 changed files with 10 additions and 11 deletions

View File

@@ -1707,7 +1707,7 @@ SYSCALL_DECLARE(mmap)
| MAP_NONBLOCK // 0x10000 | 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 size_t len0 = ihk_mc_syscall_arg1(ctx);
const int prot = ihk_mc_syscall_arg2(ctx); const int prot = ihk_mc_syscall_arg2(ctx);
const int flags0 = ihk_mc_syscall_arg3(ctx); const int flags0 = ihk_mc_syscall_arg3(ctx);
@@ -1716,7 +1716,7 @@ SYSCALL_DECLARE(mmap)
struct thread *thread = cpu_local_var(current); struct thread *thread = cpu_local_var(current);
struct vm_regions *region = &thread->vm->region; struct vm_regions *region = &thread->vm->region;
int error; int error;
intptr_t addr = 0; uintptr_t addr = 0;
size_t len; size_t len;
int flags = flags0; int flags = flags0;
size_t pgsize; size_t pgsize;

View File

@@ -1560,7 +1560,7 @@ SYSCALL_DECLARE(mmap)
| MAP_NONBLOCK // 00010000 | 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 size_t len0 = ihk_mc_syscall_arg1(ctx);
const int prot = ihk_mc_syscall_arg2(ctx); const int prot = ihk_mc_syscall_arg2(ctx);
const int flags0 = ihk_mc_syscall_arg3(ctx); const int flags0 = ihk_mc_syscall_arg3(ctx);
@@ -1569,7 +1569,7 @@ SYSCALL_DECLARE(mmap)
struct thread *thread = cpu_local_var(current); struct thread *thread = cpu_local_var(current);
struct vm_regions *region = &thread->vm->region; struct vm_regions *region = &thread->vm->region;
int error; int error;
intptr_t addr = 0; uintptr_t addr = 0;
size_t len; size_t len;
int flags = flags0; int flags = flags0;
size_t pgsize; size_t pgsize;

View File

@@ -465,7 +465,7 @@ static inline unsigned long timespec_to_jiffy(const struct timespec *ats)
void reset_cputime(void); void reset_cputime(void);
void set_cputime(int mode); void set_cputime(int mode);
int do_munmap(void *addr, size_t len, int holding_memory_range_lock); 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); off_t off0);
void clear_host_pte(uintptr_t addr, size_t len); void clear_host_pte(uintptr_t addr, size_t len);
typedef int32_t key_t; typedef int32_t key_t;

View File

@@ -1558,7 +1558,7 @@ int do_munmap(void *addr, size_t len, int holding_memory_range_lock)
return error; 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 thread *thread = cpu_local_var(current);
struct vm_regions *region = &thread->vm->region; struct vm_regions *region = &thread->vm->region;
@@ -1600,12 +1600,12 @@ out:
} }
intptr_t 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) const int flags, const int fd, const off_t off0)
{ {
struct thread *thread = cpu_local_var(current); struct thread *thread = cpu_local_var(current);
struct vm_regions *region = &thread->vm->region; struct vm_regions *region = &thread->vm->region;
intptr_t addr = addr0; uintptr_t addr = addr0;
size_t len = len0; size_t len = len0;
size_t populate_len = 0; size_t populate_len = 0;
off_t off; off_t off;
@@ -5229,7 +5229,7 @@ SYSCALL_DECLARE(shmat)
struct process_vm *vm = thread->vm; struct process_vm *vm = thread->vm;
size_t len; size_t len;
int error; int error;
intptr_t addr; uintptr_t addr;
int prot; int prot;
int vrflags; int vrflags;
int req; int req;
@@ -8105,8 +8105,7 @@ SYSCALL_DECLARE(mremap)
goto out; goto out;
} }
need_relocate = 1; need_relocate = 1;
error = search_free_space(newsize, range->pgshift, error = search_free_space(newsize, range->pgshift, &newstart);
(intptr_t *)&newstart);
if (error) { if (error) {
ekprintf("sys_mremap(%#lx,%#lx,%#lx,%#x,%#lx):" ekprintf("sys_mremap(%#lx,%#lx,%#lx,%#x,%#lx):"
"search failed. %d\n", "search failed. %d\n",