VM: full munmap
[minix.git] / lib / libsys / sys_umap_remote.c
blob2adda8ec4cb19ddb2d8a882f598116307987c2aa
1 #include "syslib.h"
3 /*===========================================================================*
4 * sys_umap_remote *
5 *===========================================================================*/
6 int sys_umap_remote(proc_ep, grantee, seg, vir_addr, bytes, phys_addr)
7 endpoint_t proc_ep; /* process number to do umap for */
8 endpoint_t grantee; /* process nr to check as grantee */
9 int seg; /* T, D, or S segment */
10 vir_bytes vir_addr; /* address in bytes with segment*/
11 vir_bytes bytes; /* number of bytes to be copied */
12 phys_bytes *phys_addr; /* placeholder for result */
14 message m;
15 int result;
17 /* Note about the grantee parameter:
18 * - Is ignored for non-grant umap calls, but should be SELF to
19 * pass the sanity check in that case;
20 * - May be SELF to get the same behaviour as sys_umap, namely that the
21 * caller must be the grantee;
22 * - In all other cases, should be a valid endpoint (neither ANY nor NONE).
25 m.CP_SRC_ENDPT = proc_ep;
26 m.CP_DST_ENDPT = grantee;
27 m.UMAP_SEG = seg;
28 m.CP_SRC_ADDR = vir_addr;
29 m.CP_NR_BYTES = bytes;
31 result = _kernel_call(SYS_UMAP_REMOTE, &m);
32 *phys_addr = m.CP_DST_ADDR;
33 return(result);