summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorFrans Kaashoek <[email protected]>2018-10-02 08:36:02 -0400
committerFrans Kaashoek <[email protected]>2018-10-02 08:40:01 -0400
commitd448fd5e6cb6595d70172195afaee56c5097e4ed (patch)
tree3158dba2a9553ebafd4dd4e5fcc7d470078136f9 /vm.c
parenta42b7d5dbb8b88aa1fb4dc508600a272c494e3f5 (diff)
downloadxv6-labs-d448fd5e6cb6595d70172195afaee56c5097e4ed.tar.gz
xv6-labs-d448fd5e6cb6595d70172195afaee56c5097e4ed.tar.bz2
xv6-labs-d448fd5e6cb6595d70172195afaee56c5097e4ed.zip
Simplify by freeing user part of addres pace in one page increments. This
undoes commit ffe444 and 052e18, which skipped page directories, but was tailored to two-level page table. Undoing doesn't seem to affect boottime for xv6 visibly.
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vm.c b/vm.c
index 9279748..444ec6d 100644
--- a/vm.c
+++ b/vm.c
@@ -305,7 +305,7 @@ deallocuvm(pde_t *pml4, uint64 oldsz, uint64 newsz)
for(; a < oldsz; a += PGSIZE){
pte = walkpgdir(pml4, (char*)a, 0);
if(!pte)
- a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE;
+ continue;
else if((*pte & PTE_P) != 0){
pa = PTE_ADDR(*pte);
if(pa == 0)
@@ -327,7 +327,7 @@ freelevel(pde_t *pgtab, int level) {
if (level > 0) {
for(i = 0; i < NPDENTRIES; i++) {
if(pgtab[i] & PTE_P){
- pd = (pdpe_t*)P2V(PTE_ADDR(pgtab[i]));
+ pd = (pde_t*)P2V(PTE_ADDR(pgtab[i]));
freelevel(pd, level-1);
}
}