aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sparc/kernel/setup.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/arch/sparc/kernel/setup.c b/arch/sparc/kernel/setup.c
index 3509e4305532..8531a8e15832 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>
@@ -389,6 +390,8 @@ console_initcall(set_preferred_console);
389extern char *sparc_cpu_type; 390extern char *sparc_cpu_type;
390extern char *sparc_fpu_type; 391extern char *sparc_fpu_type;
391 392
393static int ncpus_probed;
394
392static int show_cpuinfo(struct seq_file *m, void *__unused) 395static int show_cpuinfo(struct seq_file *m, void *__unused)
393{ 396{
394 seq_printf(m, 397 seq_printf(m,
@@ -411,7 +414,7 @@ static int show_cpuinfo(struct seq_file *m, void *__unused)
411 romvec->pv_printrev >> 16, 414 romvec->pv_printrev >> 16,
412 romvec->pv_printrev & 0xffff, 415 romvec->pv_printrev & 0xffff,
413 &cputypval, 416 &cputypval,
414 num_possible_cpus(), 417 ncpus_probed,
415 num_online_cpus() 418 num_online_cpus()
416#ifndef CONFIG_SMP 419#ifndef CONFIG_SMP
417 , cpu_data(0).udelay_val/(500000/HZ), 420 , cpu_data(0).udelay_val/(500000/HZ),
@@ -471,3 +474,30 @@ void sun_do_break(void)
471 474
472int serial_console = -1; 475int serial_console = -1;
473int stop_a_enabled = 1; 476int stop_a_enabled = 1;
477
478static int __init topology_init(void)
479{
480 int i, ncpus, err;
481
482 /* Count the number of physically present processors in
483 * the machine, even on uniprocessor, so that /proc/cpuinfo
484 * output is consistent with 2.4.x
485 */
486 ncpus = 0;
487 while (!cpu_find_by_instance(ncpus, NULL, NULL))
488 ncpus++;
489 ncpus_probed = ncpus;
490
491 err = 0;
492 for_each_online_cpu(i) {
493 struct cpu *p = kzalloc(sizeof(*p), GFP_KERNEL);
494 if (!p)
495 err = -ENOMEM;
496 else
497 register_cpu(p, i, NULL);
498 }
499
500 return err;
501}
502
503subsys_initcall(topology_init);