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

minor

上级 15cf9ce6
...@@ -127,9 +127,11 @@ cpunum(void) ...@@ -127,9 +127,11 @@ cpunum(void)
// often indirectly through acquire and release. // often indirectly through acquire and release.
if(readeflags()&FL_IF){ if(readeflags()&FL_IF){
static int n __attribute__ ((aligned (CACHELINE))); static int n __attribute__ ((aligned (CACHELINE)));
if(n++ == 0) if(n == 0) {
n++;
cprintf("cpu called from %x with interrupts enabled\n", cprintf("cpu called from %x with interrupts enabled\n",
__builtin_return_address(0)); __builtin_return_address(0));
}
} }
if(lapic) if(lapic)
......
...@@ -48,6 +48,7 @@ nsalloc(void) ...@@ -48,6 +48,7 @@ nsalloc(void)
if (ns == 0) if (ns == 0)
panic("nsalloc"); panic("nsalloc");
memset(ns, 0, sizeof(struct ns)); memset(ns, 0, sizeof(struct ns));
initlock(&ns_lock, "ns");
acquire(&ns_lock); acquire(&ns_lock);
for (int i = 0; i < NHASH; i++) { for (int i = 0; i < NHASH; i++) {
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论