int to endpoint_t conversions in mmap
This commit is contained in:
parent
cccfe8e0ce
commit
1207fcc6f0
3 changed files with 13 additions and 10 deletions
|
@ -28,9 +28,10 @@
|
||||||
_PROTOTYPE( void *mmap, (void *, size_t, int, int, int, off_t));
|
_PROTOTYPE( void *mmap, (void *, size_t, int, int, int, off_t));
|
||||||
_PROTOTYPE( int munmap, (void *, size_t));
|
_PROTOTYPE( int munmap, (void *, size_t));
|
||||||
_PROTOTYPE( int munmap_text, (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( int vm_unmap, (endpoint_t endpt, void *addr));
|
||||||
_PROTOTYPE( unsigned long vm_getphys, (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 */
|
#endif /* _MMAN_H */
|
||||||
|
|
|
@ -55,7 +55,11 @@ PUBLIC int munmap_text(void *addr, size_t len)
|
||||||
return _syscall(VM_PROC_NR, VM_MUNMAP_TEXT, &m);
|
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;
|
message m;
|
||||||
int r;
|
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;
|
return (void *) m.VMRE_RETA;
|
||||||
}
|
}
|
||||||
|
|
||||||
PUBLIC int vm_unmap(int endpt, void *addr)
|
PUBLIC int vm_unmap(endpoint_t endpt, void *addr)
|
||||||
{
|
{
|
||||||
message m;
|
message m;
|
||||||
|
|
||||||
|
@ -96,7 +100,7 @@ PUBLIC unsigned long vm_getphys(int endpt, void *addr)
|
||||||
return m.VMPHYS_RETA;
|
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;
|
message m;
|
||||||
int r;
|
int r;
|
||||||
|
|
|
@ -208,22 +208,20 @@ PUBLIC int do_unmap_phys(message *m)
|
||||||
*===========================================================================*/
|
*===========================================================================*/
|
||||||
PUBLIC int do_remap(message *m)
|
PUBLIC int do_remap(message *m)
|
||||||
{
|
{
|
||||||
int d, dn, s, sn;
|
int dn, sn;
|
||||||
vir_bytes da, sa, startv;
|
vir_bytes da, sa, startv;
|
||||||
size_t size;
|
size_t size;
|
||||||
struct vir_region *vr, *region;
|
struct vir_region *vr, *region;
|
||||||
struct vmproc *dvmp, *svmp;
|
struct vmproc *dvmp, *svmp;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
d = m->VMRE_D;
|
|
||||||
s = m->VMRE_S;
|
|
||||||
da = (vir_bytes) m->VMRE_DA;
|
da = (vir_bytes) m->VMRE_DA;
|
||||||
sa = (vir_bytes) m->VMRE_SA;
|
sa = (vir_bytes) m->VMRE_SA;
|
||||||
size = m->VMRE_SIZE;
|
size = m->VMRE_SIZE;
|
||||||
|
|
||||||
if ((r = vm_isokendpt(d, &dn)) != OK)
|
if ((r = vm_isokendpt((endpoint_t) m->VMRE_D, &dn)) != OK)
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
if ((r = vm_isokendpt(s, &sn)) != OK)
|
if ((r = vm_isokendpt((endpoint_t) m->VMRE_S, &sn)) != OK)
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
|
|
||||||
dvmp = &vmproc[dn];
|
dvmp = &vmproc[dn];
|
||||||
|
|
Loading…
Reference in a new issue