tools/llvm: Do not build with symbols
[minix3.git] / minix / kernel / arch / earm / arch_do_vmctl.c
blobbb8d231e99adbc5daa385fbf702330801ee805ed
1 /* The kernel call implemented in this file:
2 * m_type: SYS_VMCTL
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
8 */
10 #include "kernel/system.h"
11 #include <assert.h>
12 #include <minix/type.h>
14 #include "arch_proto.h"
16 static void set_ttbr(struct proc *p, u32_t ttbr, u32_t *v)
18 /* Set process TTBR. */
19 p->p_seg.p_ttbr = ttbr;
20 assert(p->p_seg.p_ttbr);
21 p->p_seg.p_ttbr_v = v;
22 if(p == get_cpulocal_var(ptproc)) {
23 write_ttbr0(p->p_seg.p_ttbr);
25 if(p->p_nr == VM_PROC_NR) {
26 if (arch_enable_paging(p) != OK)
27 panic("arch_enable_paging failed");
29 RTS_UNSET(p, RTS_VMINHIBIT);
32 /*===========================================================================*
33 * arch_do_vmctl *
34 *===========================================================================*/
35 int arch_do_vmctl(m_ptr, p)
36 register message *m_ptr; /* pointer to request message */
37 struct proc *p;
39 switch(m_ptr->SVMCTL_PARAM) {
40 case VMCTL_GET_PDBR:
41 /* Get process page directory base reg (TTBR). */
42 m_ptr->SVMCTL_VALUE = p->p_seg.p_ttbr;
43 return OK;
44 case VMCTL_SETADDRSPACE:
45 set_ttbr(p, m_ptr->SVMCTL_PTROOT, (u32_t *) m_ptr->SVMCTL_PTROOT_V);
46 return OK;
47 case VMCTL_FLUSHTLB:
49 reload_ttbr0();
50 return OK;
54 printf("arch_do_vmctl: strange param %d\n", m_ptr->SVMCTL_PARAM);
55 return EINVAL;