VM: simplify slab allocator
[minix.git] / lib / libsys / sys_vumap.c
bloba84555180f8c8ded9e5cbe713c29df6ef972f70f
1 #include "syslib.h"
3 /*===========================================================================*
4 * sys_vumap *
5 *===========================================================================*/
6 int sys_vumap(
7 endpoint_t endpt, /* source process endpoint, or SELF */
8 struct vumap_vir *vvec, /* virtual (input) vector */
9 int vcount, /* number of elements in vvec */
10 size_t offset, /* offset into first vvec element */
11 int access, /* requested safecopy access flags */
12 struct vumap_phys *pvec, /* physical (output) vector */
13 int *pcount /* (max, returned) nr of els in pvec */
16 message m;
17 int r;
19 m.VUMAP_ENDPT = endpt;
20 m.VUMAP_VADDR = (vir_bytes) vvec;
21 m.VUMAP_VCOUNT = vcount;
22 m.VUMAP_OFFSET = offset;
23 m.VUMAP_ACCESS = access;
24 m.VUMAP_PADDR = (vir_bytes) pvec;
25 m.VUMAP_PMAX = *pcount;
27 r = _kernel_call(SYS_VUMAP, &m);
29 if (r != OK)
30 return r;
32 *pcount = m.VUMAP_PCOUNT;
33 return OK;