Split off sys_umap_remote from sys_umap
sys_umap now supports only: - looking up the physical address of a virtual address in the address space of the caller; - looking up the physical address of a grant for which the caller is the grantee. This is enough for nearly all umap users. The new sys_umap_remote supports lookups in arbitrary address spaces and grants for arbitrary grantees.
This commit is contained in:
@@ -97,6 +97,7 @@ SRCS= \
|
||||
sys_times.c \
|
||||
sys_trace.c \
|
||||
sys_umap.c \
|
||||
sys_umap_remote.c \
|
||||
sys_update.c \
|
||||
sys_vinb.c \
|
||||
sys_vinl.c \
|
||||
|
||||
35
lib/libsys/sys_umap_remote.c
Executable file
35
lib/libsys/sys_umap_remote.c
Executable file
@@ -0,0 +1,35 @@
|
||||
#include "syslib.h"
|
||||
|
||||
/*===========================================================================*
|
||||
* sys_umap_remote *
|
||||
*===========================================================================*/
|
||||
PUBLIC int sys_umap_remote(proc_ep, grantee, seg, vir_addr, bytes, phys_addr)
|
||||
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).
|
||||
*/
|
||||
|
||||
m.CP_SRC_ENDPT = proc_ep;
|
||||
m.CP_DST_ENDPT = grantee;
|
||||
m.CP_SRC_SPACE = seg;
|
||||
m.CP_SRC_ADDR = vir_addr;
|
||||
m.CP_NR_BYTES = bytes;
|
||||
|
||||
result = _kernel_call(SYS_UMAP_REMOTE, &m);
|
||||
*phys_addr = m.CP_DST_ADDR;
|
||||
return(result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user