int to endpoint_t conversions in mmap

This commit is contained in:
Tomas Hruby 2010-06-09 09:14:53 +00:00
parent cccfe8e0ce
commit 1207fcc6f0
3 changed files with 13 additions and 10 deletions

View file

@ -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 */

View file

@ -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;

View file

@ -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];