1*433d6423SLionel Sambuc #include "syslib.h"
2*433d6423SLionel Sambuc
3*433d6423SLionel Sambuc /*===========================================================================*
4*433d6423SLionel Sambuc * sys_vumap *
5*433d6423SLionel Sambuc *===========================================================================*/
sys_vumap(endpoint_t endpt,struct vumap_vir * vvec,int vcount,size_t offset,int access,struct vumap_phys * pvec,int * pcount)6*433d6423SLionel Sambuc int sys_vumap(
7*433d6423SLionel Sambuc endpoint_t endpt, /* source process endpoint, or SELF */
8*433d6423SLionel Sambuc struct vumap_vir *vvec, /* virtual (input) vector */
9*433d6423SLionel Sambuc int vcount, /* number of elements in vvec */
10*433d6423SLionel Sambuc size_t offset, /* offset into first vvec element */
11*433d6423SLionel Sambuc int access, /* requested safecopy access flags */
12*433d6423SLionel Sambuc struct vumap_phys *pvec, /* physical (output) vector */
13*433d6423SLionel Sambuc int *pcount /* (max, returned) nr of els in pvec */
14*433d6423SLionel Sambuc )
15*433d6423SLionel Sambuc {
16*433d6423SLionel Sambuc message m;
17*433d6423SLionel Sambuc int r;
18*433d6423SLionel Sambuc
19*433d6423SLionel Sambuc m.m_lsys_krn_sys_vumap.endpt = endpt;
20*433d6423SLionel Sambuc m.m_lsys_krn_sys_vumap.vaddr = (vir_bytes) vvec;
21*433d6423SLionel Sambuc m.m_lsys_krn_sys_vumap.vcount = vcount;
22*433d6423SLionel Sambuc m.m_lsys_krn_sys_vumap.offset = offset;
23*433d6423SLionel Sambuc m.m_lsys_krn_sys_vumap.access = access;
24*433d6423SLionel Sambuc m.m_lsys_krn_sys_vumap.paddr = (vir_bytes) pvec;
25*433d6423SLionel Sambuc m.m_lsys_krn_sys_vumap.pmax = *pcount;
26*433d6423SLionel Sambuc
27*433d6423SLionel Sambuc r = _kernel_call(SYS_VUMAP, &m);
28*433d6423SLionel Sambuc
29*433d6423SLionel Sambuc if (r != OK)
30*433d6423SLionel Sambuc return r;
31*433d6423SLionel Sambuc
32*433d6423SLionel Sambuc *pcount = m.m_krn_lsys_sys_vumap.pcount;
33*433d6423SLionel Sambuc return OK;
34*433d6423SLionel Sambuc }
35