2012-03-21 23:51:18 +01:00
|
|
|
#include "syslib.h"
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* sys_vumap *
|
|
|
|
*===========================================================================*/
|
2012-03-25 20:25:53 +02:00
|
|
|
int sys_vumap(
|
2012-03-21 23:51:18 +01:00
|
|
|
endpoint_t endpt, /* source process endpoint, or SELF */
|
|
|
|
struct vumap_vir *vvec, /* virtual (input) vector */
|
|
|
|
int vcount, /* number of elements in vvec */
|
|
|
|
size_t offset, /* offset into first vvec element */
|
|
|
|
int access, /* requested safecopy access flags */
|
|
|
|
struct vumap_phys *pvec, /* physical (output) vector */
|
|
|
|
int *pcount /* (max, returned) nr of els in pvec */
|
|
|
|
)
|
|
|
|
{
|
|
|
|
message m;
|
|
|
|
int r;
|
|
|
|
|
2014-05-22 10:05:44 +02:00
|
|
|
m.m_lsys_krn_sys_vumap.endpt = endpt;
|
|
|
|
m.m_lsys_krn_sys_vumap.vaddr = (vir_bytes) vvec;
|
|
|
|
m.m_lsys_krn_sys_vumap.vcount = vcount;
|
|
|
|
m.m_lsys_krn_sys_vumap.offset = offset;
|
|
|
|
m.m_lsys_krn_sys_vumap.access = access;
|
|
|
|
m.m_lsys_krn_sys_vumap.paddr = (vir_bytes) pvec;
|
|
|
|
m.m_lsys_krn_sys_vumap.pmax = *pcount;
|
2012-03-21 23:51:18 +01:00
|
|
|
|
|
|
|
r = _kernel_call(SYS_VUMAP, &m);
|
|
|
|
|
|
|
|
if (r != OK)
|
|
|
|
return r;
|
|
|
|
|
2014-05-22 10:05:44 +02:00
|
|
|
*pcount = m.m_krn_lsys_sys_vumap.pcount;
|
2012-03-21 23:51:18 +01:00
|
|
|
return OK;
|
|
|
|
}
|