From: Arun Thomas Date: Sat, 11 Aug 2012 15:45:35 +0000 (+0200) Subject: Rename sys_vmctl_get_cr3_i386 X-Git-Tag: v3.2.1~378 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/ddns-confgen.html?a=commitdiff_plain;h=697f0d097fee50418622ec08895c5a7df30f4d2a;p=minix.git Rename sys_vmctl_get_cr3_i386 --- diff --git a/include/minix/com.h b/include/minix/com.h index 2e99f1068..9bf3a411d 100644 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -616,8 +616,8 @@ /* Values for SVMCTL_PARAM. */ #define VMCTL_CLEAR_PAGEFAULT 12 -#define VMCTL_I386_GETCR3 13 -#define VMCTL_MEMREQ_GET 14 +#define VMCTL_GET_PDBR 13 +#define VMCTL_MEMREQ_GET 14 #define VMCTL_MEMREQ_REPLY 15 #define VMCTL_NOPAGEZERO 18 #define VMCTL_I386_KERNELLIMIT 19 diff --git a/include/minix/syslib.h b/include/minix/syslib.h index 8aaf28715..7614a0259 100644 --- a/include/minix/syslib.h +++ b/include/minix/syslib.h @@ -66,7 +66,7 @@ int sys_vm_setbuf(phys_bytes base, phys_bytes size, phys_bytes high); int sys_vm_map(endpoint_t proc_ep, int do_map, phys_bytes base, phys_bytes size, phys_bytes offset); int sys_vmctl(endpoint_t who, int param, u32_t value); -int sys_vmctl_get_cr3_i386(endpoint_t who, u32_t *cr3); +int sys_vmctl_get_pdbr(endpoint_t who, u32_t *pdbr); int sys_vmctl_get_memreq(endpoint_t *who, vir_bytes *mem, vir_bytes *len, int *wrflag, endpoint_t *who_s, vir_bytes *mem_s, endpoint_t *); int sys_vmctl_enable_paging(void * data); diff --git a/kernel/arch/i386/arch_do_vmctl.c b/kernel/arch/i386/arch_do_vmctl.c index bb134c680..c6f36ec46 100644 --- a/kernel/arch/i386/arch_do_vmctl.c +++ b/kernel/arch/i386/arch_do_vmctl.c @@ -41,8 +41,8 @@ register message *m_ptr; /* pointer to request message */ struct proc *p; { switch(m_ptr->SVMCTL_PARAM) { - case VMCTL_I386_GETCR3: - /* Get process CR3. */ + case VMCTL_GET_PDBR: + /* Get process page directory base reg (CR3). */ m_ptr->SVMCTL_VALUE = p->p_seg.p_cr3; return OK; case VMCTL_SETADDRSPACE: diff --git a/lib/libsys/sys_vmctl.c b/lib/libsys/sys_vmctl.c index 08951f65c..f7472ece0 100644 --- a/lib/libsys/sys_vmctl.c +++ b/lib/libsys/sys_vmctl.c @@ -12,16 +12,17 @@ int sys_vmctl(endpoint_t who, int param, u32_t value) return(r); } -int sys_vmctl_get_cr3_i386(endpoint_t who, u32_t *cr3) +/* Get page directory base register */ +int sys_vmctl_get_pdbr(endpoint_t who, u32_t *pdbr) { message m; int r; m.SVMCTL_WHO = who; - m.SVMCTL_PARAM = VMCTL_I386_GETCR3; + m.SVMCTL_PARAM = VMCTL_GET_PDBR; r = _kernel_call(SYS_VMCTL, &m); if(r == OK) { - *cr3 = m.SVMCTL_VALUE; + *pdbr = m.SVMCTL_VALUE; } return(r); } diff --git a/servers/vm/arch/i386/pagetable.c b/servers/vm/arch/i386/pagetable.c index 6831ec3c2..67a99d2f2 100644 --- a/servers/vm/arch/i386/pagetable.c +++ b/servers/vm/arch/i386/pagetable.c @@ -859,7 +859,7 @@ void pt_init(void) vir_bytes sparepages_mem; static u32_t currentpagedir[I386_VM_DIR_ENTRIES]; int m = kernel_boot_info.kern_mod; - u32_t mycr3; + u32_t mypdbr; /* Page Directory Base Register (cr3) value */ /* Find what the physical location of the kernel is. */ assert(m >= 0); @@ -978,9 +978,9 @@ void pt_init(void) panic("vm pt_new failed"); /* Get our current pagedir so we can see it. */ - if(sys_vmctl_get_cr3_i386(SELF, &mycr3) != OK) - panic("VM: sys_vmctl_get_cr3_i386 failed"); - if(sys_vircopy(NONE, mycr3, SELF, + if(sys_vmctl_get_pdbr(SELF, &mypdbr) != OK) + panic("VM: sys_vmctl_get_pdbr failed"); + if(sys_vircopy(NONE, mypdbr, SELF, (vir_bytes) currentpagedir, I386_PAGE_SIZE) != OK) panic("VM: sys_vircopy failed");