don't print SYSTEM stacktrace on exceptions as it's not scheduled any more.
[minix.git] / lib / libsys / sys_safemap.c
blob26bfbcbb4757c759e854a2e537ba83739ba91058
2 #include "syslib.h"
4 #include <minix/safecopies.h>
6 /*===========================================================================*
7 * sys_safemap *
8 *===========================================================================*/
9 PUBLIC int sys_safemap(endpoint_t grantor, cp_grant_id_t grant,
10 vir_bytes grant_offset, vir_bytes my_address,
11 size_t bytes, int my_seg, int writable)
13 /* Map a block of data for which the other process has previously
14 * granted permission.
17 message copy_mess;
19 copy_mess.SMAP_EP = grantor;
20 copy_mess.SMAP_GID = grant;
21 copy_mess.SMAP_OFFSET = grant_offset;
22 copy_mess.SMAP_SEG = (void*) my_seg;
23 copy_mess.SMAP_ADDRESS = my_address;
24 copy_mess.SMAP_BYTES = bytes;
25 copy_mess.SMAP_FLAG = writable;
27 return(_kernel_call(SYS_SAFEMAP, &copy_mess));
31 /*===========================================================================*
32 * sys_saferevmap_gid *
33 *===========================================================================*/
34 PUBLIC int sys_saferevmap_gid(cp_grant_id_t grant)
36 /* Grantor revokes safemap by grant id. */
37 message copy_mess;
39 copy_mess.SMAP_FLAG = 1;
40 copy_mess.SMAP_GID = grant;
42 return(_kernel_call(SYS_SAFEREVMAP, &copy_mess));
45 /*===========================================================================*
46 * sys_saferevmap_addr *
47 *===========================================================================*/
48 PUBLIC int sys_saferevmap_addr(vir_bytes addr)
50 /* Grantor revokes safemap by address. */
51 message copy_mess;
53 copy_mess.SMAP_FLAG = 0;
54 copy_mess.SMAP_GID = addr;
56 return(_kernel_call(SYS_SAFEREVMAP, &copy_mess));
59 /*===========================================================================*
60 * sys_safeunmap *
61 *===========================================================================*/
62 PUBLIC int sys_safeunmap(int my_seg, vir_bytes my_address)
64 /* Requestor unmaps safemap. */
65 message copy_mess;
67 copy_mess.SMAP_SEG = (void*) my_seg;
68 copy_mess.SMAP_ADDRESS = my_address;
70 return(_kernel_call(SYS_SAFEUNMAP, &copy_mess));