]> Devi Nivas Git - cs3210-lab1.git/commitdiff
Merge branch 'master' of git+ssh://amsterdam.csail.mit.edu/home/am0/6.828/xv6
authorRobert Morris <rtm@csail.mit.edu>
Tue, 31 Aug 2010 23:21:52 +0000 (19:21 -0400)
committerRobert Morris <rtm@csail.mit.edu>
Tue, 31 Aug 2010 23:21:52 +0000 (19:21 -0400)
1  2 
kalloc.c

diff --cc kalloc.c
index 43e80e80a273aa2217eaf7c84cb06cee6bb9bacf,7653242af3a9dd07d375dc1810d23595c1752b45..5f690f55399b3e82458d4dd5fe3d9a2ed0226e99
+++ b/kalloc.c
@@@ -24,11 -24,13 +24,12 @@@ kinit(void
    extern char end[];
  
    initlock(&kmem.lock, "kmem");
 -  char *p1 = (char*)PGROUNDUP((uint)end);
 -  char *p2 = PGROUNDDOWN(PHYSTOP);
 -  for( ; p1 < p2; p1 += 4096)
 -    kfree(p1);
 +  char *p = (char*)PGROUNDUP((uint)end);
 +  for( ; p + PGSIZE - 1 < (char*) PHYSTOP; p += PGSIZE)
 +    kfree(p);
  }
  
+ //PAGEBREAK: 21
  // Free the page of physical memory pointed at by v,
  // which normally should have been returned by a
  // call to kalloc().  (The exception is when