diff options
author | David S. Miller <davem@davemloft.net> | 2006-05-31 04:24:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-05-31 04:24:02 -0400 |
commit | 951bc82c53f30ec6b4c2d04a051e74ea9a89b669 (patch) | |
tree | 5c8dfd8c9b56291705053cb98382cd79d990c770 /arch/sparc64/kernel/head.S | |
parent | e6ed89ac9f5da16fea5111651b6de0ff0a76a5c2 (diff) |
[SPARC64]: Make smp_processor_id() functional before start_kernel()
Uses of smp_processor_id() get pushed earlier and earlier in
the start_kernel() sequence. So just get it working before
we call start_kernel() to avoid all possible problems.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/head.S')
-rw-r--r-- | arch/sparc64/kernel/head.S | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/sparc64/kernel/head.S b/arch/sparc64/kernel/head.S index 3eadac5e171e..31c5892f5acc 100644 --- a/arch/sparc64/kernel/head.S +++ b/arch/sparc64/kernel/head.S | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/config.h> | 10 | #include <linux/config.h> |
11 | #include <linux/version.h> | 11 | #include <linux/version.h> |
12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
13 | #include <linux/threads.h> | ||
13 | #include <asm/thread_info.h> | 14 | #include <asm/thread_info.h> |
14 | #include <asm/asi.h> | 15 | #include <asm/asi.h> |
15 | #include <asm/pstate.h> | 16 | #include <asm/pstate.h> |
@@ -493,6 +494,35 @@ tlb_fixup_done: | |||
493 | call prom_init | 494 | call prom_init |
494 | mov %l7, %o0 ! OpenPROM cif handler | 495 | mov %l7, %o0 ! OpenPROM cif handler |
495 | 496 | ||
497 | /* Initialize current_thread_info()->cpu as early as possible. | ||
498 | * In order to do that accurately we have to patch up the get_cpuid() | ||
499 | * assembler sequences. And that, in turn, requires that we know | ||
500 | * if we are on a Starfire box or not. While we're here, patch up | ||
501 | * the sun4v sequences as well. | ||
502 | */ | ||
503 | call check_if_starfire | ||
504 | nop | ||
505 | call per_cpu_patch | ||
506 | nop | ||
507 | call sun4v_patch | ||
508 | nop | ||
509 | |||
510 | #ifdef CONFIG_SMP | ||
511 | call hard_smp_processor_id | ||
512 | nop | ||
513 | cmp %o0, NR_CPUS | ||
514 | blu,pt %xcc, 1f | ||
515 | nop | ||
516 | call boot_cpu_id_too_large | ||
517 | nop | ||
518 | /* Not reached... */ | ||
519 | |||
520 | 1: | ||
521 | #else | ||
522 | mov 0, %o0 | ||
523 | #endif | ||
524 | stb %o0, [%g6 + TI_CPU] | ||
525 | |||
496 | /* Off we go.... */ | 526 | /* Off we go.... */ |
497 | call start_kernel | 527 | call start_kernel |
498 | nop | 528 | nop |