summaryrefslogtreecommitdiff
path: root/kalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'kalloc.c')
-rw-r--r--kalloc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/kalloc.c b/kalloc.c
index 65de759..8c9ff93 100644
--- a/kalloc.c
+++ b/kalloc.c
@@ -19,11 +19,13 @@ struct {
// Initialize free list of physical pages.
void
-kinit(char *p, uint len)
+kinit(void)
{
+ extern char end[];
+
initlock(&kmem.lock, "kmem");
- char *p1 = (char*)PGROUNDUP((uint)p);
- char *p2 = PGROUNDDOWN(p + len);
+ char *p1 = (char*)PGROUNDUP((uint)end);
+ char *p2 = PGROUNDDOWN(PHYSTOP);
for( ; p1 < p2; p1 += 4096)
kfree(p1);
}