1 /* The kernel call implemented in this file:
4 * The parameters for this kernel call are:
5 * m_lsys_krn_sys_umap.src_endpt (process number)
6 * m_lsys_krn_sys_umap.segment (segment where address is: T, D, or S)
7 * m_lsys_krn_sys_umap.src_addr (virtual address)
8 * m_krn_lsys_sys_umap.dst_addr (returns physical address)
9 * m_lsys_krn_sys_umap.nr_bytes (size of datastructure)
12 #include "kernel/system.h"
14 #include <minix/endpoint.h>
22 /*==========================================================================*
24 *==========================================================================*/
25 int do_umap(struct proc
* caller
, message
* m_ptr
)
27 int seg_index
= m_ptr
->m_lsys_krn_sys_umap
.segment
& SEGMENT_INDEX
;
28 int endpt
= m_ptr
->m_lsys_krn_sys_umap
.src_endpt
;
30 /* This call is a subset of umap_remote, it allows mapping virtual addresses
31 * in the caller's address space and grants where the caller is specified as
32 * grantee; after the security check we simply invoke do_umap_remote
34 if (seg_index
!= MEM_GRANT
&& endpt
!= SELF
) return EPERM
;
35 m_ptr
->m_lsys_krn_sys_umap
.dst_endpt
= SELF
;
36 return do_umap_remote(caller
, m_ptr
);