From b71aa5f5e9d7be338811828a8fefcf5bec52e894 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Mon, 2 Feb 2004 23:22:24 +0000 Subject: [PATCH] Set PCPU_GET(curpcb) for the BSP to thread0's pcb. Otherwise, the boot CPU doesn't have a pcb until after it's first context switch. This can cause secondary panics if a page fault happens during bootup. --- sys/i386/i386/machdep.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 524e2261a345..bd5d7864a4d4 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -2010,6 +2010,7 @@ init386(first) pcpu_init(pc, 0, sizeof(struct pcpu)); PCPU_SET(prvspace, pc); PCPU_SET(curthread, &thread0); + PCPU_SET(curpcb, thread0.td_pcb); /* * Initialize mutexes.