Commit 7202fb49 authored by Bob Breuer's avatar Bob Breuer Committed by David S. Miller

[SPARC]: Setup cpu_possible_map

Setup cpu_possible_map so the secondary cpus will get started.
Signed-off-by: default avatarBob Breuer <breuerr@mc.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a8cbdcea
...@@ -349,6 +349,8 @@ void __init setup_arch(char **cmdline_p) ...@@ -349,6 +349,8 @@ void __init setup_arch(char **cmdline_p)
init_mm.context = (unsigned long) NO_CONTEXT; init_mm.context = (unsigned long) NO_CONTEXT;
init_task.thread.kregs = &fake_swapper_regs; init_task.thread.kregs = &fake_swapper_regs;
smp_setup_cpu_possible_map();
paging_init(); paging_init();
} }
......
...@@ -267,22 +267,18 @@ int setup_profiling_timer(unsigned int multiplier) ...@@ -267,22 +267,18 @@ int setup_profiling_timer(unsigned int multiplier)
void __init smp_prepare_cpus(unsigned int max_cpus) void __init smp_prepare_cpus(unsigned int max_cpus)
{ {
extern void smp4m_boot_cpus(void); extern void smp4m_boot_cpus(void);
int i, cpuid, ncpus, extra; int i, cpuid, extra;
BUG_ON(sparc_cpu_model != sun4m); BUG_ON(sparc_cpu_model != sun4m);
printk("Entering SMP Mode...\n"); printk("Entering SMP Mode...\n");
ncpus = 1;
extra = 0; extra = 0;
for (i = 0; !cpu_find_by_instance(i, NULL, &cpuid); i++) { for (i = 0; !cpu_find_by_instance(i, NULL, &cpuid); i++) {
if (cpuid == boot_cpu_id) if (cpuid >= NR_CPUS)
continue;
if (cpuid < NR_CPUS && ncpus++ < max_cpus)
cpu_set(cpuid, phys_cpu_present_map);
else
extra++; 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"); printk("Warning: NR_CPUS is too low to start all cpus\n");
smp_store_cpu_info(boot_cpu_id); smp_store_cpu_info(boot_cpu_id);
...@@ -290,6 +286,24 @@ void __init smp_prepare_cpus(unsigned int max_cpus) ...@@ -290,6 +286,24 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
smp4m_boot_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) void __devinit smp_prepare_boot_cpu(void)
{ {
int cpuid = hard_smp_processor_id(); int cpuid = hard_smp_processor_id();
......
...@@ -146,6 +146,8 @@ static inline int hard_smp_processor_id(void) ...@@ -146,6 +146,8 @@ static inline int hard_smp_processor_id(void)
#define prof_multiplier(__cpu) cpu_data(__cpu).multiplier #define prof_multiplier(__cpu) cpu_data(__cpu).multiplier
#define prof_counter(__cpu) cpu_data(__cpu).counter #define prof_counter(__cpu) cpu_data(__cpu).counter
void smp_setup_cpu_possible_map(void);
#endif /* !(__ASSEMBLY__) */ #endif /* !(__ASSEMBLY__) */
/* Sparc specific messages. */ /* Sparc specific messages. */
...@@ -162,7 +164,11 @@ static inline int hard_smp_processor_id(void) ...@@ -162,7 +164,11 @@ static inline int hard_smp_processor_id(void)
#define MBOX_IDLECPU2 0xFD #define MBOX_IDLECPU2 0xFD
#define MBOX_STOPCPU2 0xFE #define MBOX_STOPCPU2 0xFE
#endif /* SMP */ #else /* SMP */
#define smp_setup_cpu_possible_map() do { } while (0)
#endif /* !(SMP) */
#define NO_PROC_ID 0xFF #define NO_PROC_ID 0xFF
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment