Remove building with NOCRYPTO option
[minix.git] / minix / kernel / system / do_umap.c
blob9c0128bf9fd56c0dbe41fab5cbf3c0a35d2fd383
1 /* The kernel call implemented in this file:
2 * m_type: SYS_UMAP
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>
16 #if USE_UMAP
18 #if ! USE_UMAP_REMOTE
19 #undef do_umap_remote
20 #endif
22 /*==========================================================================*
23 * do_umap *
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);
39 #endif /* USE_UMAP */