xref: /minix3/minix/lib/libsys/sys_umap.c (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc #include "syslib.h"
2*433d6423SLionel Sambuc 
3*433d6423SLionel Sambuc /*===========================================================================*
4*433d6423SLionel Sambuc  *                                sys_umap				     *
5*433d6423SLionel Sambuc  *===========================================================================*/
sys_umap(proc_ep,seg,vir_addr,bytes,phys_addr)6*433d6423SLionel Sambuc int sys_umap(proc_ep, seg, vir_addr, bytes, phys_addr)
7*433d6423SLionel Sambuc endpoint_t proc_ep;			/* process number to do umap for */
8*433d6423SLionel Sambuc int seg;				/* T, D, or S segment */
9*433d6423SLionel Sambuc vir_bytes vir_addr;			/* address in bytes with segment*/
10*433d6423SLionel Sambuc vir_bytes bytes;			/* number of bytes to be copied */
11*433d6423SLionel Sambuc phys_bytes *phys_addr;			/* placeholder for result */
12*433d6423SLionel Sambuc {
13*433d6423SLionel Sambuc     message m;
14*433d6423SLionel Sambuc     int result;
15*433d6423SLionel Sambuc 
16*433d6423SLionel Sambuc     m.m_lsys_krn_sys_umap.src_endpt = proc_ep;
17*433d6423SLionel Sambuc     m.m_lsys_krn_sys_umap.segment = seg;
18*433d6423SLionel Sambuc     m.m_lsys_krn_sys_umap.src_addr = vir_addr;
19*433d6423SLionel Sambuc     m.m_lsys_krn_sys_umap.nr_bytes = bytes;
20*433d6423SLionel Sambuc 
21*433d6423SLionel Sambuc     result = _kernel_call(SYS_UMAP, &m);
22*433d6423SLionel Sambuc     *phys_addr = m.m_krn_lsys_sys_umap.dst_addr;
23*433d6423SLionel Sambuc     return(result);
24*433d6423SLionel Sambuc }
25*433d6423SLionel Sambuc 
26