[PATCH 19/19] ppc64: Use setup_cpu_maps() instead of iSeries specific smp code
Michael Ellerman
michael at ellerman.id.au
Tue Jul 26 18:58:43 EST 2005
Call setup_cpu_maps() on iSeries which will setup the cpu maps from the device
tree. This removes the need for smp_iSeries_numProcs() and makes
smp_iSeries_probe() a one-liner.
---
arch/ppc64/kernel/iSeries_smp.c | 30 +-----------------------------
arch/ppc64/kernel/setup.c | 8 +-------
2 files changed, 2 insertions(+), 36 deletions(-)
Index: work/arch/ppc64/kernel/iSeries_smp.c
===================================================================
--- work.orig/arch/ppc64/kernel/iSeries_smp.c
+++ work/arch/ppc64/kernel/iSeries_smp.c
@@ -82,35 +82,9 @@ static void smp_iSeries_message_pass(int
}
}
-static int smp_iSeries_numProcs(void)
-{
- unsigned np, i;
-
- np = 0;
- for (i=0; i < NR_CPUS; ++i) {
- if (paca[i].lppaca.dyn_proc_status < 2) {
- cpu_set(i, cpu_possible_map);
- cpu_set(i, cpu_present_map);
- cpu_set(i, cpu_sibling_map[i]);
- ++np;
- }
- }
- return np;
-}
-
static int smp_iSeries_probe(void)
{
- unsigned i;
- unsigned np = 0;
-
- for (i=0; i < NR_CPUS; ++i) {
- if (paca[i].lppaca.dyn_proc_status < 2) {
- /*paca[i].active = 1;*/
- ++np;
- }
- }
-
- return np;
+ return cpus_weight(cpu_possible_map);
}
static void smp_iSeries_kick_cpu(int nr)
@@ -144,6 +118,4 @@ static struct smp_ops_t iSeries_smp_ops
void __init smp_init_iSeries(void)
{
smp_ops = &iSeries_smp_ops;
- systemcfg->processorCount = smp_iSeries_numProcs();
}
-
Index: work/arch/ppc64/kernel/setup.c
===================================================================
--- work.orig/arch/ppc64/kernel/setup.c
+++ work/arch/ppc64/kernel/setup.c
@@ -182,8 +182,6 @@ void __init disable_early_printk(void)
early_console_initialized = 0;
}
-#if defined(CONFIG_PPC_MULTIPLATFORM) && defined(CONFIG_SMP)
-
static int smt_enabled_cmdline;
/* Look for ibm,smt-enabled OF option */
@@ -335,7 +333,6 @@ static void __init setup_cpu_maps(void)
systemcfg->processorCount = num_present_cpus();
}
-#endif /* defined(CONFIG_PPC_MULTIPLATFORM) && defined(CONFIG_SMP) */
#ifdef CONFIG_PPC_MULTIPLATFORM
@@ -637,12 +634,9 @@ void __init setup_system(void)
parse_early_param();
-#if defined(CONFIG_SMP) && !defined(CONFIG_PPC_ISERIES)
- /*
- * iSeries has already initialized the cpu maps at this point.
- */
setup_cpu_maps();
+#if defined(CONFIG_SMP) && !defined(CONFIG_PPC_ISERIES)
/* Release secondary cpus out of their spinloops at 0x60 now that
* we can map physical -> logical CPU ids
*/
More information about the Linuxppc64-dev
mailing list