From abf847a083888bbed4260ecacf849ea19f23e810 Mon Sep 17 00:00:00 2001 From: Frans Kaashoek <kaashoek@mit.edu> Date: Tue, 31 Jan 2017 17:47:16 -0500 Subject: Start of an experiment to remove the use of gs for cpu local variables. --- console.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'console.c') diff --git a/console.c b/console.c index 4d678b0..f7e1e73 100644 --- a/console.c +++ b/console.c @@ -111,7 +111,7 @@ panic(char *s) cli(); cons.locking = 0; - cprintf("cpu with apicid %d: panic: ", cpu->apicid); + cprintf("cpu %d: panic: ", cpuid()); cprintf(s); cprintf("\n"); getcallerpcs(&s, pcs); @@ -242,7 +242,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; -- cgit v1.2.3 From 2e2d14c235b570a6beb222fc1bfa53de85a98de3 Mon Sep 17 00:00:00 2001 From: Frans Kaashoek <kaashoek@mit.edu> Date: Wed, 1 Feb 2017 19:21:43 -0500 Subject: use panic --- console.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'console.c') diff --git a/console.c b/console.c index f7e1e73..da28f9f 100644 --- a/console.c +++ b/console.c @@ -111,7 +111,8 @@ panic(char *s) cli(); cons.locking = 0; - cprintf("cpu %d: panic: ", cpuid()); + // use lapiccpunum so that we can call panic from mycpu() + cprintf("cpu %d: panic: ", lapiccpunum()); cprintf(s); cprintf("\n"); getcallerpcs(&s, pcs); -- cgit v1.2.3 From c9fa90f7e514f27fa1ac071cd9795f3830ab6a1b Mon Sep 17 00:00:00 2001 From: Frans Kaashoek <kaashoek@mit.edu> Date: Wed, 1 Feb 2017 20:36:41 -0500 Subject: A tiny bit of clean up (e.g., move code searching cpu array from lapic.c into mycpu() in proc.c. --- console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'console.c') diff --git a/console.c b/console.c index da28f9f..ca00a5f 100644 --- a/console.c +++ b/console.c @@ -112,7 +112,7 @@ panic(char *s) cli(); cons.locking = 0; // use lapiccpunum so that we can call panic from mycpu() - cprintf("cpu %d: panic: ", lapiccpunum()); + cprintf("lapicid %d: panic: ", lapicid()); cprintf(s); cprintf("\n"); getcallerpcs(&s, pcs); -- cgit v1.2.3