提交 929a4d12 创建 作者: Nickolai Zeldovich's avatar Nickolai Zeldovich

panic when calling cpunum() with interrupts enabled

上级 9621812e
......@@ -142,16 +142,10 @@ cpunum(void)
{
// Cannot call cpu when interrupts are enabled:
// result not guaranteed to last long enough to be used!
// Would prefer to panic but even printing is chancy here:
// almost everything, including cprintf and panic, calls cpu,
// often indirectly through acquire and release.
if(readrflags()&FL_IF){
static int n __mpalign__;
if(n == 0) {
n++;
cprintf("cpu called from %p with interrupts enabled\n",
__builtin_return_address(0));
}
cli();
panic("cpunum() called from %p with interrupts enabled\n",
__builtin_return_address(0));
}
if(lapic)
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论