diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-13 05:49:41 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-13 05:49:41 -0500 |
commit | 98a79d6a50181ca1ecf7400eda01d5dc1bc0dbf0 (patch) | |
tree | e8829ee975b77745da153b9d23601e3a1497ad68 /arch/alpha/kernel/smp.c | |
parent | 6c34bc2976b30dc8b56392c020e25bae1f363cab (diff) |
cpumask: centralize cpu_online_map and cpu_possible_map
Impact: cleanup
Each SMP arch defines these themselves. Move them to a central
location.
Twists:
1) Some archs (m32, parisc, s390) set possible_map to all 1, so we add a
CONFIG_INIT_ALL_POSSIBLE for this rather than break them.
2) mips and sparc32 '#define cpu_possible_map phys_cpu_present_map'.
Those archs simply have phys_cpu_present_map replaced everywhere.
3) Alpha defined cpu_possible_map to cpu_present_map; this is tricky
so I just manipulate them both in sync.
4) IA64, cris and m32r have gratuitous 'extern cpumask_t cpu_possible_map'
declarations.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Grant Grundler <grundler@parisc-linux.org>
Tested-by: Tony Luck <tony.luck@intel.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Mike Travis <travis@sgi.com>
Cc: ink@jurassic.park.msu.ru
Cc: rmk@arm.linux.org.uk
Cc: starvik@axis.com
Cc: tony.luck@intel.com
Cc: takata@linux-m32r.org
Cc: ralf@linux-mips.org
Cc: grundler@parisc-linux.org
Cc: paulus@samba.org
Cc: schwidefsky@de.ibm.com
Cc: lethal@linux-sh.org
Cc: wli@holomorphy.com
Cc: davem@davemloft.net
Cc: jdike@addtoit.com
Cc: mingo@redhat.com
Diffstat (limited to 'arch/alpha/kernel/smp.c')
-rw-r--r-- | arch/alpha/kernel/smp.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index cf7da10097bb..d953e510f68d 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c | |||
@@ -70,11 +70,6 @@ enum ipi_message_type { | |||
70 | /* Set to a secondary's cpuid when it comes online. */ | 70 | /* Set to a secondary's cpuid when it comes online. */ |
71 | static int smp_secondary_alive __devinitdata = 0; | 71 | static int smp_secondary_alive __devinitdata = 0; |
72 | 72 | ||
73 | /* Which cpus ids came online. */ | ||
74 | cpumask_t cpu_online_map; | ||
75 | |||
76 | EXPORT_SYMBOL(cpu_online_map); | ||
77 | |||
78 | int smp_num_probed; /* Internal processor count */ | 73 | int smp_num_probed; /* Internal processor count */ |
79 | int smp_num_cpus = 1; /* Number that came online. */ | 74 | int smp_num_cpus = 1; /* Number that came online. */ |
80 | EXPORT_SYMBOL(smp_num_cpus); | 75 | EXPORT_SYMBOL(smp_num_cpus); |
@@ -440,6 +435,7 @@ setup_smp(void) | |||
440 | ((char *)cpubase + i*hwrpb->processor_size); | 435 | ((char *)cpubase + i*hwrpb->processor_size); |
441 | if ((cpu->flags & 0x1cc) == 0x1cc) { | 436 | if ((cpu->flags & 0x1cc) == 0x1cc) { |
442 | smp_num_probed++; | 437 | smp_num_probed++; |
438 | cpu_set(i, cpu_possible_map); | ||
443 | cpu_set(i, cpu_present_map); | 439 | cpu_set(i, cpu_present_map); |
444 | cpu->pal_revision = boot_cpu_palrev; | 440 | cpu->pal_revision = boot_cpu_palrev; |
445 | } | 441 | } |
@@ -473,6 +469,7 @@ smp_prepare_cpus(unsigned int max_cpus) | |||
473 | 469 | ||
474 | /* Nothing to do on a UP box, or when told not to. */ | 470 | /* Nothing to do on a UP box, or when told not to. */ |
475 | if (smp_num_probed == 1 || max_cpus == 0) { | 471 | if (smp_num_probed == 1 || max_cpus == 0) { |
472 | cpu_possible_map = cpumask_of_cpu(boot_cpuid); | ||
476 | cpu_present_map = cpumask_of_cpu(boot_cpuid); | 473 | cpu_present_map = cpumask_of_cpu(boot_cpuid); |
477 | printk(KERN_INFO "SMP mode deactivated.\n"); | 474 | printk(KERN_INFO "SMP mode deactivated.\n"); |
478 | return; | 475 | return; |