diff options
author | Robert Morris <rtm@csail.mit.edu> | 2010-08-31 19:21:33 -0400 |
---|---|---|
committer | Robert Morris <rtm@csail.mit.edu> | 2010-08-31 19:21:33 -0400 |
commit | 3597d5dc704c192a85b9902f7264fe9025aad277 (patch) | |
tree | 21c0f34eae262c4d9edd9d4f1aaf97d26a0c82a4 /kalloc.c | |
parent | 1aee6a6c4f1227dd4737ba5c88306acfba893828 (diff) | |
download | xv6-labs-3597d5dc704c192a85b9902f7264fe9025aad277.tar.gz xv6-labs-3597d5dc704c192a85b9902f7264fe9025aad277.tar.bz2 xv6-labs-3597d5dc704c192a85b9902f7264fe9025aad277.zip |
oops. last minute simplicifaction to kalloc().
Diffstat (limited to 'kalloc.c')
-rw-r--r-- | kalloc.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -24,10 +24,9 @@ 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); } // Free the page of physical memory pointed at by v, |