1 /* The kernel call implemented in this file:
4 * The parameters for this kernel call are:
5 * SVMCTL_WHO which process
6 * SVMCTL_PARAM set this setting (VMCTL_*)
7 * SVMCTL_VALUE to this value
10 #include "kernel/system.h"
11 #include <minix/type.h>
15 /*===========================================================================*
17 *===========================================================================*/
18 PUBLIC
int arch_do_vmctl(m_ptr
, p
)
19 register message
*m_ptr
; /* pointer to request message */
22 switch(m_ptr
->SVMCTL_PARAM
) {
23 case VMCTL_I386_GETCR3
:
24 /* Get process CR3. */
25 m_ptr
->SVMCTL_VALUE
= p
->p_seg
.p_cr3
;
27 case VMCTL_SETADDRSPACE
:
28 /* Set process CR3. */
29 if(m_ptr
->SVMCTL_PTROOT
) {
30 p
->p_seg
.p_cr3
= m_ptr
->SVMCTL_PTROOT
;
31 p
->p_seg
.p_cr3_v
= (u32_t
*) m_ptr
->SVMCTL_PTROOT_V
;
32 p
->p_misc_flags
|= MF_FULLVM
;
35 p
->p_seg
.p_cr3_v
= NULL
;
36 p
->p_misc_flags
&= ~MF_FULLVM
;
38 RTS_UNSET(p
, RTS_VMINHIBIT
);
41 /* Increase process SP. */
42 p
->p_reg
.sp
+= m_ptr
->SVMCTL_VALUE
;
44 case VMCTL_I386_KERNELLIMIT
:
47 /* VM wants kernel to increase its segment. */
48 r
= prot_set_kern_seg_limit(m_ptr
->SVMCTL_VALUE
);
51 case VMCTL_I386_FREEPDE
:
53 i386_freepde(m_ptr
->SVMCTL_VALUE
);
65 printf("arch_do_vmctl: strange param %d\n", m_ptr
->SVMCTL_PARAM
);