3 int sys_vmctl(endpoint_t who
, int param
, u32_t value
)
9 m
.SVMCTL_PARAM
= param
;
10 m
.SVMCTL_VALUE
= value
;
11 r
= _kernel_call(SYS_VMCTL
, &m
);
15 /* Get page directory base register */
16 int sys_vmctl_get_pdbr(endpoint_t who
, u32_t
*pdbr
)
22 m
.SVMCTL_PARAM
= VMCTL_GET_PDBR
;
23 r
= _kernel_call(SYS_VMCTL
, &m
);
25 *pdbr
= m
.SVMCTL_VALUE
;
30 int sys_vmctl_set_addrspace(endpoint_t who
,
31 phys_bytes ptroot
, void *ptroot_v
)
37 m
.SVMCTL_PARAM
= VMCTL_SETADDRSPACE
;
38 m
.SVMCTL_PTROOT
= ptroot
;
39 m
.SVMCTL_PTROOT_V
= ptroot_v
;
40 r
= _kernel_call(SYS_VMCTL
, &m
);
45 int sys_vmctl_get_memreq(endpoint_t
*who
, vir_bytes
*mem
,
46 vir_bytes
*len
, int *wrflag
, endpoint_t
*who_s
, vir_bytes
*mem_s
,
47 endpoint_t
*requestor
)
53 m
.SVMCTL_PARAM
= VMCTL_MEMREQ_GET
;
54 r
= _kernel_call(SYS_VMCTL
, &m
);
56 *who
= m
.SVMCTL_MRG_TARGET
;
57 *mem
= m
.SVMCTL_MRG_ADDR
;
58 *len
= m
.SVMCTL_MRG_LENGTH
;
59 *wrflag
= m
.SVMCTL_MRG_FLAG
;
60 *who_s
= m
.SVMCTL_MRG_EP2
;
61 *mem_s
= m
.SVMCTL_MRG_ADDR2
;
62 *requestor
= (endpoint_t
) m
.SVMCTL_MRG_REQUESTOR
;
67 int sys_vmctl_get_mapping(int index
,
68 phys_bytes
*addr
, phys_bytes
*len
, int *flags
)
74 m
.SVMCTL_PARAM
= VMCTL_KERN_PHYSMAP
;
75 m
.SVMCTL_VALUE
= (int) index
;
77 r
= _kernel_call(SYS_VMCTL
, &m
);
82 *addr
= m
.SVMCTL_MAP_PHYS_ADDR
;
83 *len
= m
.SVMCTL_MAP_PHYS_LEN
;
84 *flags
= m
.SVMCTL_MAP_FLAGS
;
89 int sys_vmctl_reply_mapping(int index
, vir_bytes addr
)
94 m
.SVMCTL_PARAM
= VMCTL_KERN_MAP_REPLY
;
95 m
.SVMCTL_VALUE
= index
;
96 m
.SVMCTL_MAP_VIR_ADDR
= (char *) addr
;
98 return _kernel_call(SYS_VMCTL
, &m
);