aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/kernel/setup.c')
-rw-r--r--arch/sparc/kernel/setup.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/arch/sparc/kernel/setup.c b/arch/sparc/kernel/setup.c
index 3509e4305532..2cbf282f0d00 100644
--- a/arch/sparc/kernel/setup.c
+++ b/arch/sparc/kernel/setup.c
@@ -31,6 +31,7 @@
31#include <linux/console.h> 31#include <linux/console.h>
32#include <linux/spinlock.h> 32#include <linux/spinlock.h>
33#include <linux/root_dev.h> 33#include <linux/root_dev.h>
34#include <linux/cpu.h>
34 35
35#include <asm/system.h> 36#include <asm/system.h>
36#include <asm/io.h> 37#include <asm/io.h>
@@ -348,6 +349,8 @@ void __init setup_arch(char **cmdline_p)
348 init_mm.context = (unsigned long) NO_CONTEXT; 349 init_mm.context = (unsigned long) NO_CONTEXT;
349 init_task.thread.kregs = &fake_swapper_regs; 350 init_task.thread.kregs = &fake_swapper_regs;
350 351
352 smp_setup_cpu_possible_map();
353
351 paging_init(); 354 paging_init();
352} 355}
353 356
@@ -389,6 +392,8 @@ console_initcall(set_preferred_console);
389extern char *sparc_cpu_type; 392extern char *sparc_cpu_type;
390extern char *sparc_fpu_type; 393extern char *sparc_fpu_type;
391 394
395static int ncpus_probed;
396
392static int show_cpuinfo(struct seq_file *m, void *__unused) 397static int show_cpuinfo(struct seq_file *m, void *__unused)
393{ 398{
394 seq_printf(m, 399 seq_printf(m,
@@ -411,7 +416,7 @@ static int show_cpuinfo(struct seq_file *m, void *__unused)
411 romvec->pv_printrev >> 16, 416 romvec->pv_printrev >> 16,
412 romvec->pv_printrev & 0xffff, 417 romvec->pv_printrev & 0xffff,
413 &cputypval, 418 &cputypval,
414 num_possible_cpus(), 419 ncpus_probed,
415 num_online_cpus() 420 num_online_cpus()
416#ifndef CONFIG_SMP 421#ifndef CONFIG_SMP
417 , cpu_data(0).udelay_val/(500000/HZ), 422 , cpu_data(0).udelay_val/(500000/HZ),
@@ -471,3 +476,30 @@ void sun_do_break(void)
471 476
472int serial_console = -1; 477int serial_console = -1;
473int stop_a_enabled = 1; 478int stop_a_enabled = 1;
479
480static int __init topology_init(void)
481{
482 int i, ncpus, err;
483
484 /* Count the number of physically present processors in
485 * the machine, even on uniprocessor, so that /proc/cpuinfo
486 * output is consistent with 2.4.x
487 */
488 ncpus = 0;
489 while (!cpu_find_by_instance(ncpus, NULL, NULL))
490 ncpus++;
491 ncpus_probed = ncpus;
492
493 err = 0;
494 for_each_online_cpu(i) {
495 struct cpu *p = kzalloc(sizeof(*p), GFP_KERNEL);
496 if (!p)
497 err = -ENOMEM;
498 else
499 register_cpu(p, i, NULL);
500 }
501
502 return err;
503}
504
505subsys_initcall(topology_init);