summaryrefslogtreecommitdiff
path: root/console.c
diff options
context:
space:
mode:
Diffstat (limited to 'console.c')
-rw-r--r--console.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/console.c b/console.c
index 4d678b0..ca00a5f 100644
--- a/console.c
+++ b/console.c
@@ -111,7 +111,8 @@ panic(char *s)
cli();
cons.locking = 0;
- cprintf("cpu with apicid %d: panic: ", cpu->apicid);
+ // use lapiccpunum so that we can call panic from mycpu()
+ cprintf("lapicid %d: panic: ", lapicid());
cprintf(s);
cprintf("\n");
getcallerpcs(&s, pcs);
@@ -242,7 +243,7 @@ consoleread(struct inode *ip, char *dst, int n)
acquire(&cons.lock);
while(n > 0){
while(input.r == input.w){
- if(proc->killed){
+ if(myproc()->killed){
release(&cons.lock);
ilock(ip);
return -1;