Remove unused typedefs
This commit is contained in:
parent
ec110149ed
commit
343080f7ae
2
mmu.h
2
mmu.h
|
@ -118,8 +118,6 @@ struct segdesc {
|
||||||
|
|
||||||
#ifndef __ASSEMBLER__
|
#ifndef __ASSEMBLER__
|
||||||
|
|
||||||
typedef uint64 pml4e_t;
|
|
||||||
typedef uint64 pdpe_t;
|
|
||||||
typedef uint64 pte_t;
|
typedef uint64 pte_t;
|
||||||
|
|
||||||
struct taskstate {
|
struct taskstate {
|
||||||
|
|
10
vm.c
10
vm.c
|
@ -67,18 +67,18 @@ static pte_t *
|
||||||
walkpgdir(pde_t *pml4, const void *va, int alloc)
|
walkpgdir(pde_t *pml4, const void *va, int alloc)
|
||||||
{
|
{
|
||||||
pde_t *pgtab = pml4;
|
pde_t *pgtab = pml4;
|
||||||
pde_t *pde;
|
pde_t *pte;
|
||||||
int level;
|
int level;
|
||||||
|
|
||||||
for (level = L_PML4; level > 0; level--) {
|
for (level = L_PML4; level > 0; level--) {
|
||||||
pde = &pgtab[PX(level, va)];
|
pte = &pgtab[PX(level, va)];
|
||||||
if(*pde & PTE_P)
|
if(*pte & PTE_P)
|
||||||
pgtab = (pte_t*)P2V(PTE_ADDR(*pde));
|
pgtab = (pte_t*)P2V(PTE_ADDR(*pte));
|
||||||
else {
|
else {
|
||||||
if(!alloc || (pgtab = (pte_t*)kalloc()) == 0)
|
if(!alloc || (pgtab = (pte_t*)kalloc()) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
memset(pgtab, 0, PGSIZE);
|
memset(pgtab, 0, PGSIZE);
|
||||||
*pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U;
|
*pte = V2P(pgtab) | PTE_P | PTE_W | PTE_U;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return &pgtab[PX(level, va)];
|
return &pgtab[PX(level, va)];
|
||||||
|
|
Loading…
Reference in a new issue