summaryrefslogtreecommitdiff
path: root/kalloc.c
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2019-06-04 10:43:45 -0400
committerRobert Morris <[email protected]>2019-06-04 10:43:45 -0400
commit0e131b226336808c135795f5b9d7defc5a58b2ae (patch)
tree226cf0c8f1043d99175aee8835baf570cdf662e6 /kalloc.c
parentb78894f34ebbceb23bcf36ff820fefb942b54ccf (diff)
downloadxv6-labs-0e131b226336808c135795f5b9d7defc5a58b2ae.tar.gz
xv6-labs-0e131b226336808c135795f5b9d7defc5a58b2ae.tar.bz2
xv6-labs-0e131b226336808c135795f5b9d7defc5a58b2ae.zip
fix a problem with end. make uartputc() wait until h/w is ready.
Diffstat (limited to 'kalloc.c')
-rw-r--r--kalloc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/kalloc.c b/kalloc.c
index cfbbae4..1ed1c49 100644
--- a/kalloc.c
+++ b/kalloc.c
@@ -27,8 +27,6 @@ void
kinit()
{
initlock(&kmem.lock, "kmem");
- if(PHYSTOP > RAMDISK)
- panic("kinit");
freerange(end, (void*)PHYSTOP);
}
@@ -76,7 +74,7 @@ kalloc(void)
if(r)
kmem.freelist = r->next;
release(&kmem.lock);
- memset((char*)r, 5, PGSIZE); // fill with junk
+ if(r)
+ memset((char*)r, 5, PGSIZE); // fill with junk
return (void*)r;
}
-