diff options
author | Robert Morris <[email protected]> | 2019-06-04 11:31:50 -0400 |
---|---|---|
committer | Robert Morris <[email protected]> | 2019-06-04 11:31:50 -0400 |
commit | cff3ce6e04ce4a353324630df788df21566807a6 (patch) | |
tree | 31040a8262b6de165a2f1d6cc7ead1db33e67a80 /vm.c | |
parent | 0e131b226336808c135795f5b9d7defc5a58b2ae (diff) | |
download | xv6-labs-cff3ce6e04ce4a353324630df788df21566807a6.tar.gz xv6-labs-cff3ce6e04ce4a353324630df788df21566807a6.tar.bz2 xv6-labs-cff3ce6e04ce4a353324630df788df21566807a6.zip |
more sbrk fixes
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -148,8 +148,10 @@ unmappages(pagetable_t pagetable, uint64 va, uint64 size, int do_free) for(;;){ if((pte = walk(pagetable, a, 0)) == 0) panic("unmappages: walk"); - if((*pte & PTE_V) == 0) + if((*pte & PTE_V) == 0){ + printf("va=%p pte=%p\n", a, *pte); panic("unmappages: not mapped"); + } if(PTE_FLAGS(*pte) == PTE_V) panic("unmappages: not a leaf"); if(do_free){ @@ -203,7 +205,8 @@ uvmalloc(pagetable_t pagetable, uint64 oldsz, uint64 newsz) if(newsz < oldsz) return oldsz; - a = PGROUNDUP(oldsz); + oldsz = PGROUNDUP(oldsz); + a = oldsz; for(; a < newsz; a += PGSIZE){ mem = kalloc(); if(mem == 0){ |