2011-06-10 16:28:20 +02:00
|
|
|
#include "syslib.h"
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* sys_umap_remote *
|
|
|
|
*===========================================================================*/
|
2012-03-25 20:25:53 +02:00
|
|
|
int sys_umap_remote(proc_ep, grantee, seg, vir_addr, bytes, phys_addr)
|
2011-06-10 16:28:20 +02:00
|
|
|
endpoint_t proc_ep; /* process number to do umap for */
|
|
|
|
endpoint_t grantee; /* process nr to check as grantee */
|
|
|
|
int seg; /* T, D, or S segment */
|
|
|
|
vir_bytes vir_addr; /* address in bytes with segment*/
|
|
|
|
vir_bytes bytes; /* number of bytes to be copied */
|
|
|
|
phys_bytes *phys_addr; /* placeholder for result */
|
|
|
|
{
|
|
|
|
message m;
|
|
|
|
int result;
|
|
|
|
|
|
|
|
/* Note about the grantee parameter:
|
|
|
|
* - Is ignored for non-grant umap calls, but should be SELF to
|
|
|
|
* pass the sanity check in that case;
|
|
|
|
* - May be SELF to get the same behaviour as sys_umap, namely that the
|
|
|
|
* caller must be the grantee;
|
|
|
|
* - In all other cases, should be a valid endpoint (neither ANY nor NONE).
|
|
|
|
*/
|
|
|
|
|
2014-05-21 17:54:35 +02:00
|
|
|
m.m_lsys_krn_sys_umap.src_endpt = proc_ep;
|
|
|
|
m.m_lsys_krn_sys_umap.dst_endpt = grantee;
|
|
|
|
m.m_lsys_krn_sys_umap.segment = seg;
|
|
|
|
m.m_lsys_krn_sys_umap.src_addr = vir_addr;
|
|
|
|
m.m_lsys_krn_sys_umap.nr_bytes = bytes;
|
2011-06-10 16:28:20 +02:00
|
|
|
|
|
|
|
result = _kernel_call(SYS_UMAP_REMOTE, &m);
|
2014-05-21 17:54:35 +02:00
|
|
|
*phys_addr = m.m_krn_lsys_sys_umap.dst_addr;
|
2011-06-10 16:28:20 +02:00
|
|
|
return(result);
|
|
|
|
}
|
|
|
|
|