use panic
This commit is contained in:
parent
7c00ce8110
commit
2e2d14c235
|
@ -111,7 +111,8 @@ panic(char *s)
|
||||||
|
|
||||||
cli();
|
cli();
|
||||||
cons.locking = 0;
|
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(s);
|
||||||
cprintf("\n");
|
cprintf("\n");
|
||||||
getcallerpcs(&s, pcs);
|
getcallerpcs(&s, pcs);
|
||||||
|
|
8
proc.c
8
proc.c
|
@ -36,12 +36,8 @@ cpuid() {
|
||||||
struct cpu*
|
struct cpu*
|
||||||
mycpu(void)
|
mycpu(void)
|
||||||
{
|
{
|
||||||
if(readeflags()&FL_IF){
|
if(readeflags()&FL_IF)
|
||||||
// Would prefer to panic but panic calls mycpu().
|
panic("mycpu called with interrupts enabled\n");
|
||||||
cprintf("mycpu called from %x with interrupts enabled\n",
|
|
||||||
__builtin_return_address(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
return &cpus[lapiccpunum()];
|
return &cpus[lapiccpunum()];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue