should be a fix for #1018. The new cpu detect code was running on each cpu as they come up, storing

away cpuid info into the current cpu structure. Trouble was the code was running before the current
thread pointer was set on each cpu, so it was always looking up cpu 0's structure and saving there,
leaving the other ones uninitialized. Surprisingly this works fine on my machine, but obviously fails
on others (cpuid info would have been zeroed probably). Solution is to change the order that things
are brought up on each cpu to set the current thread pointer first. I don't really like that solution
but it'll work for now. Added a comment to the effect.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20154 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Travis Geiselbrecht 2007-02-18 04:11:43 +00:00
parent 637812eb4a
commit 306a9ae49f

View File

@ -166,9 +166,14 @@ _start(kernel_args *bootKernelArgs, int currentCPU)
resume_thread(thread);
} else {
// this is run for each non boot processor after they've been set loose
// the order here is pretty important, and kind of arch specific, so it's sort of a hack at the moment.
// thread_* will set the current thread pointer, which lets low level code know what cpu it's on
// cpu_* will detect the current cpu and do any pending low level setup
// smp_* will set up the low level smp routines
thread_per_cpu_init(currentCPU);
cpu_init_percpu(&sKernelArgs, currentCPU);
smp_per_cpu_init(&sKernelArgs, currentCPU);
thread_per_cpu_init(currentCPU);
enable_interrupts();
}