From aee58e2da0c688785939850d85b12b57fbb12396 Mon Sep 17 00:00:00 2001 From: marcel Date: Sat, 18 Nov 2006 23:15:25 +0000 Subject: Since printf also has at least one critical section, we need to initialize pc_curthread. While here, rename early_pcpu to pcpu0 to be conistent (compare thread0 and proc0). --- sys/ia64/ia64/machdep.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'sys/ia64') diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index d59c5e4..a57fc4f 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -108,7 +108,7 @@ int cold = 1; u_int64_t pa_bootinfo; struct bootinfo bootinfo; -struct pcpu early_pcpu; +struct pcpu pcpu0; extern char kstack[]; vm_offset_t proc0kstack; @@ -601,11 +601,14 @@ ia64_init(void) bootverbose = 1; /* - * Setup the global data for the bootstrap cpu. + * Setup the PCPU data for the bootstrap processor. It is needed + * by printf(). Also, since printf() has critical sections, we + * need to initialize at least pc_curthread. */ - pcpup = &early_pcpu; + pcpup = &pcpu0; ia64_set_k4((u_int64_t)pcpup); - pcpu_init(pcpup, 0, sizeof(early_pcpu)); + pcpu_init(pcpup, 0, sizeof(pcpu0)); + PCPU_SET(curthread, &thread0); /* * Initialize the console before we print anything out. @@ -782,7 +785,6 @@ ia64_init(void) proc0kstack = (vm_offset_t)kstack; thread0.td_kstack = proc0kstack; thread0.td_kstack_pages = KSTACK_PAGES; - PCPU_SET(curthread, &thread0); mutex_init(); -- cgit v1.1