From: Tomas Hruby Date: Wed, 9 Jun 2010 09:14:53 +0000 (+0000) Subject: int to endpoint_t conversions in mmap X-Git-Tag: v3.1.8~485 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/dnssec-revoke.html?a=commitdiff_plain;h=1207fcc6f0c9a4bf71ba7fc33b3dfd31f1b87a70;p=minix.git int to endpoint_t conversions in mmap --- diff --git a/include/sys/mman.h b/include/sys/mman.h index 55b9a0b09..29d82a1bd 100644 --- a/include/sys/mman.h +++ b/include/sys/mman.h @@ -28,9 +28,10 @@ _PROTOTYPE( void *mmap, (void *, size_t, int, int, int, off_t)); _PROTOTYPE( int munmap, (void *, size_t)); _PROTOTYPE( int munmap_text, (void *, size_t)); -_PROTOTYPE( void *vm_remap, (int d, int s, void *da, void *sa, size_t si)); +_PROTOTYPE( void *vm_remap, (endpoint_t d, endpoint_t s, void *da, + void *sa, size_t si)); _PROTOTYPE( int vm_unmap, (endpoint_t endpt, void *addr)); _PROTOTYPE( unsigned long vm_getphys, (endpoint_t endpt, void *addr)); -_PROTOTYPE( u8_t vm_getrefcount, (int endpt, void *addr)); +_PROTOTYPE( u8_t vm_getrefcount, (endpoint_t endpt, void *addr)); #endif /* _MMAN_H */ diff --git a/lib/libc/posix/_mmap.c b/lib/libc/posix/_mmap.c index a01602015..26e2164d7 100644 --- a/lib/libc/posix/_mmap.c +++ b/lib/libc/posix/_mmap.c @@ -55,7 +55,11 @@ PUBLIC int munmap_text(void *addr, size_t len) return _syscall(VM_PROC_NR, VM_MUNMAP_TEXT, &m); } -PUBLIC void *vm_remap(int d, int s, void *da, void *sa, size_t size) +PUBLIC void *vm_remap(endpoint_t d, + endpoint_t s, + void *da, + void *sa, + size_t size) { message m; int r; @@ -72,7 +76,7 @@ PUBLIC void *vm_remap(int d, int s, void *da, void *sa, size_t size) return (void *) m.VMRE_RETA; } -PUBLIC int vm_unmap(int endpt, void *addr) +PUBLIC int vm_unmap(endpoint_t endpt, void *addr) { message m; @@ -96,7 +100,7 @@ PUBLIC unsigned long vm_getphys(int endpt, void *addr) return m.VMPHYS_RETA; } -PUBLIC u8_t vm_getrefcount(int endpt, void *addr) +PUBLIC u8_t vm_getrefcount(endpoint_t endpt, void *addr) { message m; int r; diff --git a/servers/vm/mmap.c b/servers/vm/mmap.c index c85847a6d..71fc025c8 100644 --- a/servers/vm/mmap.c +++ b/servers/vm/mmap.c @@ -208,22 +208,20 @@ PUBLIC int do_unmap_phys(message *m) *===========================================================================*/ PUBLIC int do_remap(message *m) { - int d, dn, s, sn; + int dn, sn; vir_bytes da, sa, startv; size_t size; struct vir_region *vr, *region; struct vmproc *dvmp, *svmp; int r; - d = m->VMRE_D; - s = m->VMRE_S; da = (vir_bytes) m->VMRE_DA; sa = (vir_bytes) m->VMRE_SA; size = m->VMRE_SIZE; - if ((r = vm_isokendpt(d, &dn)) != OK) + if ((r = vm_isokendpt((endpoint_t) m->VMRE_D, &dn)) != OK) return EINVAL; - if ((r = vm_isokendpt(s, &sn)) != OK) + if ((r = vm_isokendpt((endpoint_t) m->VMRE_S, &sn)) != OK) return EINVAL; dvmp = &vmproc[dn];