4 #include <minix/safecopies.h>
6 /*===========================================================================*
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
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
, ©_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. */
39 copy_mess
.SMAP_FLAG
= 1;
40 copy_mess
.SMAP_GID
= grant
;
42 return(_kernel_call(SYS_SAFEREVMAP
, ©_mess
));
45 /*===========================================================================*
46 * sys_saferevmap_addr *
47 *===========================================================================*/
48 PUBLIC
int sys_saferevmap_addr(vir_bytes addr
)
50 /* Grantor revokes safemap by address. */
53 copy_mess
.SMAP_FLAG
= 0;
54 copy_mess
.SMAP_GID
= addr
;
56 return(_kernel_call(SYS_SAFEREVMAP
, ©_mess
));
59 /*===========================================================================*
61 *===========================================================================*/
62 PUBLIC
int sys_safeunmap(int my_seg
, vir_bytes my_address
)
64 /* Requestor unmaps safemap. */
67 copy_mess
.SMAP_SEG
= (void*) my_seg
;
68 copy_mess
.SMAP_ADDRESS
= my_address
;
70 return(_kernel_call(SYS_SAFEUNMAP
, ©_mess
));