3 PUBLIC
int sys_vmctl(endpoint_t who
, int param
, u32_t value
)
9 m
.SVMCTL_PARAM
= param
;
10 m
.SVMCTL_VALUE
= value
;
11 r
= _taskcall(SYSTASK
, SYS_VMCTL
, &m
);
15 PUBLIC
int sys_vmctl_get_pagefault_i386(endpoint_t
*who
, u32_t
*cr2
, u32_t
*err
)
21 m
.SVMCTL_PARAM
= VMCTL_GET_PAGEFAULT
;
22 r
= _taskcall(SYSTASK
, SYS_VMCTL
, &m
);
24 *who
= m
.SVMCTL_PF_WHO
;
25 *cr2
= m
.SVMCTL_PF_I386_CR2
;
26 *err
= m
.SVMCTL_PF_I386_ERR
;
31 PUBLIC
int sys_vmctl_get_cr3_i386(endpoint_t who
, u32_t
*cr3
)
37 m
.SVMCTL_PARAM
= VMCTL_I386_GETCR3
;
38 r
= _taskcall(SYSTASK
, SYS_VMCTL
, &m
);
40 *cr3
= m
.SVMCTL_VALUE
;
45 PUBLIC
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
= _taskcall(SYSTASK
, 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 PUBLIC
int sys_vmctl_enable_paging(struct mem_map
*map
)
71 m
.SVMCTL_PARAM
= VMCTL_ENABLE_PAGING
;
72 m
.SVMCTL_VALUE
= (int) map
;
73 return _taskcall(SYSTASK
, SYS_VMCTL
, &m
);
76 PUBLIC
int sys_vmctl_get_mapping(int index
,
77 phys_bytes
*addr
, phys_bytes
*len
, int *flags
)
83 m
.SVMCTL_PARAM
= VMCTL_KERN_PHYSMAP
;
84 m
.SVMCTL_VALUE
= (int) index
;
86 r
= _taskcall(SYSTASK
, SYS_VMCTL
, &m
);
91 *addr
= m
.SVMCTL_MAP_PHYS_ADDR
;
92 *len
= m
.SVMCTL_MAP_PHYS_LEN
;
93 *flags
= m
.SVMCTL_MAP_FLAGS
;
98 PUBLIC
int sys_vmctl_reply_mapping(int index
, vir_bytes addr
)
104 m
.SVMCTL_PARAM
= VMCTL_KERN_MAP_REPLY
;
105 m
.SVMCTL_VALUE
= index
;
106 m
.SVMCTL_MAP_VIR_ADDR
= (char *) addr
;
108 return _taskcall(SYSTASK
, SYS_VMCTL
, &m
);