diff options
| -rw-r--r-- | console.c | 3 | ||||
| -rw-r--r-- | proc.c | 8 | 
2 files changed, 4 insertions, 7 deletions
| @@ -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); @@ -36,12 +36,8 @@ cpuid() {  struct cpu*  mycpu(void)  { -  if(readeflags()&FL_IF){ -    // Would prefer to panic but panic calls mycpu(). -    cprintf("mycpu called from %x with interrupts enabled\n", -        __builtin_return_address(0)); -  } - +  if(readeflags()&FL_IF) +    panic("mycpu called with interrupts enabled\n");    return &cpus[lapiccpunum()];  } | 
