Rename sys_vmctl_get_cr3_i386

This commit is contained in:
Arun Thomas 2012-08-11 17:45:35 +02:00
parent 263ec1e885
commit 697f0d097f
5 changed files with 13 additions and 12 deletions

View file

@ -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

View file

@ -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);

View file

@ -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:

View file

@ -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);
}

View file

@ -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");