summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorFrans Kaashoek <[email protected]>2011-08-24 10:24:40 -0400
committerFrans Kaashoek <[email protected]>2011-08-24 10:24:40 -0400
commit6f2327580fe9a5f5b093814126fe7ffc02345407 (patch)
treef086e4708d345ad93fc7642e7426f52dbdade494 /vm.c
parent194f8bf739d441283c56985017c4a6f1b35a99cd (diff)
downloadxv6-labs-6f2327580fe9a5f5b093814126fe7ffc02345407.tar.gz
xv6-labs-6f2327580fe9a5f5b093814126fe7ffc02345407.tar.bz2
xv6-labs-6f2327580fe9a5f5b093814126fe7ffc02345407.zip
Eliminate USERTOP; no use for it.
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/vm.c b/vm.c
index e509a72..59c95ca 100644
--- a/vm.c
+++ b/vm.c
@@ -99,7 +99,7 @@ mappages(pde_t *pgdir, void *va, uint size, uint pa, int perm, char* (*alloc)(vo
// than its memory.
//
// setupkvm() and exec() set up every page table like this:
-// 0..USERTOP : user memory (text, data, stack, heap), mapped to some unused phys mem
+// 0..KERNBASE : user memory (text, data, stack, heap), mapped to some unused phys mem
// KERNBASE..KERNBASE+EXTMEM: mapped to 0..EXTMEM (below extended memory)
// KERNBASE+EXTMEM..KERNBASE+end : mapped to EXTMEM..end (mapped without write permission)
// KERNBASE+end..KERBASE+PHYSTOP : mapped to end..PHYSTOP (rw data + free memory)
@@ -223,7 +223,7 @@ allocuvm(pde_t *pgdir, uint oldsz, uint newsz)
char *mem;
uint a;
- if(newsz > USERTOP)
+ if(newsz >= KERNBASE)
return 0;
if(newsz < oldsz)
return oldsz;
@@ -279,7 +279,7 @@ freevm(pde_t *pgdir)
if(pgdir == 0)
panic("freevm: no pgdir");
- deallocuvm(pgdir, USERTOP, 0);
+ deallocuvm(pgdir, KERNBASE, 0);
for(i = 0; i < NPDENTRIES; i++){
if(pgdir[i] & PTE_P) {
char * v = p2v(PTE_ADDR(pgdir[i]));