VM: full munmap
[minix.git] / lib / libsys / vm_map_phys.c
blobe9837438769e7e5beacc148dffbca96bcb3d3469
1 #define _SYSTEM 1
2 #include <lib.h>
3 #include <sys/mman.h>
4 #include <minix/syslib.h>
5 #include <minix/vm.h>
6 #include <stdarg.h>
7 #include <string.h>
8 #include <errno.h>
10 void *vm_map_phys(endpoint_t who, void *phaddr, size_t len)
12 message m;
13 int r;
15 m.VMMP_EP = who;
16 m.VMMP_PHADDR = phaddr;
17 m.VMMP_LEN = len;
19 r = _taskcall(VM_PROC_NR, VM_MAP_PHYS, &m);
21 if(r != OK) return MAP_FAILED;
23 return (void *) m.VMMP_VADDR_REPLY;
26 int vm_unmap_phys(endpoint_t who, void *vaddr, size_t len)
28 message m;
30 m.VMUP_EP = who;
31 m.VMUP_VADDR = vaddr;
33 return _taskcall(VM_PROC_NR, VM_UNMAP_PHYS, &m);