aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/smp.c
diff options
context:
space:
mode:
authorBob Breuer <breuerr@mc.net>2006-06-20 00:30:31 -0700
committerDavid S. Miller <davem@davemloft.net>2006-06-20 00:30:31 -0700
commit7202fb496af235506a3c6fea836fe4c9957f730e (patch)
tree44e5338a62fe866da0f9bac2f9bfb75226e4ca32 /arch/sparc/kernel/smp.c
parenta8cbdcea341ac2f404ee81aa1c19d54aaa0416b4 (diff)
downloadkernel_samsung_tuna-7202fb496af235506a3c6fea836fe4c9957f730e.zip
kernel_samsung_tuna-7202fb496af235506a3c6fea836fe4c9957f730e.tar.gz
kernel_samsung_tuna-7202fb496af235506a3c6fea836fe4c9957f730e.tar.bz2
[SPARC]: Setup cpu_possible_map
Setup cpu_possible_map so the secondary cpus will get started. Signed-off-by: Bob Breuer <breuerr@mc.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/smp.c')
-rw-r--r--arch/sparc/kernel/smp.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/arch/sparc/kernel/smp.c b/arch/sparc/kernel/smp.c
index 40b42c8..d0ccb8a 100644
--- a/arch/sparc/kernel/smp.c
+++ b/arch/sparc/kernel/smp.c
@@ -267,22 +267,18 @@ int setup_profiling_timer(unsigned int multiplier)
void __init smp_prepare_cpus(unsigned int max_cpus)
{
extern void smp4m_boot_cpus(void);
- int i, cpuid, ncpus, extra;
+ int i, cpuid, extra;
BUG_ON(sparc_cpu_model != sun4m);
printk("Entering SMP Mode...\n");
- ncpus = 1;
extra = 0;
for (i = 0; !cpu_find_by_instance(i, NULL, &cpuid); i++) {
- if (cpuid == boot_cpu_id)
- continue;
- if (cpuid < NR_CPUS && ncpus++ < max_cpus)
- cpu_set(cpuid, phys_cpu_present_map);
- else
+ if (cpuid >= NR_CPUS)
extra++;
}
- if (max_cpus >= NR_CPUS && extra)
+ /* i = number of cpus */
+ if (extra && max_cpus > i - extra)
printk("Warning: NR_CPUS is too low to start all cpus\n");
smp_store_cpu_info(boot_cpu_id);
@@ -290,6 +286,24 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
smp4m_boot_cpus();
}
+/* Set this up early so that things like the scheduler can init
+ * properly. We use the same cpu mask for both the present and
+ * possible cpu map.
+ */
+void __init smp_setup_cpu_possible_map(void)
+{
+ int instance, mid;
+
+ instance = 0;
+ while (!cpu_find_by_instance(instance, NULL, &mid)) {
+ if (mid < NR_CPUS) {
+ cpu_set(mid, phys_cpu_present_map);
+ cpu_set(mid, cpu_present_map);
+ }
+ instance++;
+ }
+}
+
void __devinit smp_prepare_boot_cpu(void)
{
int cpuid = hard_smp_processor_id();