[ppc64] UP compile fixes, from Paul Mackerras

Minor fixes to make the UP case compile, export cpu_possible_map,
fix up whitespace etc.


---

 arch/ppc64/kernel/prom.c  |   29 +++++++++++++++++------------
 arch/ppc64/kernel/setup.c |    7 +++++--
 arch/ppc64/kernel/smp.c   |    4 +++-
 include/asm-ppc64/smp.h   |    8 +++++---
 include/linux/proc_fs.h   |    1 +
 5 files changed, 31 insertions(+), 18 deletions(-)

diff -puN arch/ppc64/kernel/prom.c~ppc64-UP_cleanup arch/ppc64/kernel/prom.c
--- 25/arch/ppc64/kernel/prom.c~ppc64-UP_cleanup	2004-01-13 23:22:47.000000000 -0800
+++ 25-akpm/arch/ppc64/kernel/prom.c	2004-01-13 23:22:47.000000000 -0800
@@ -1009,7 +1009,7 @@ prom_hold_cpus(unsigned long mem)
 				prom_print_hex(cpu_threads);
 				prom_print(RELOC(", max is "));
 				prom_print_hex(MAX_CPU_THREADS);
-		prom_print_nl();
+				prom_print_nl();
 				cpu_threads = 1; /* ToDo: panic? */
 			}
 		}
@@ -1020,27 +1020,31 @@ prom_hold_cpus(unsigned long mem)
 			prom_print_hex(cpuid);
 			prom_print(RELOC(" : starting cpu "));
 			prom_print(path);
-		prom_print(RELOC("..."));
+			prom_print(RELOC("..."));
 			call_prom(RELOC("start-cpu"), 3, 0, node, 
 				  secondary_hold, cpuid);
 
-		for ( i = 0 ; (i < 100000000) && 
+			for ( i = 0 ; (i < 100000000) && 
 			      (*acknowledge == ((unsigned long)-1)); i++ ) ;
 
-		if (*acknowledge == cpuid) {
-			prom_print(RELOC("ok\n"));
-			/* Set the number of active processors. */
-			_systemcfg->processorCount++;
+			if (*acknowledge == cpuid) {
+				prom_print(RELOC("ok\n"));
+#ifdef CONFIG_SMP
+				/* Set the number of active processors. */
+				_systemcfg->processorCount++;
 				cpu_set(cpuid, RELOC(cpu_available_map));
 				cpu_set(cpuid, RELOC(cpu_possible_map));
 				cpu_set(cpuid, RELOC(cpu_present_at_boot));
-		} else {
-			prom_print(RELOC("failed: "));
-			prom_print_hex(*acknowledge);
-			prom_print_nl();
+#endif
+			} else {
+				prom_print(RELOC("failed: "));
+				prom_print_hex(*acknowledge);
+				prom_print_nl();
 				/* prom_panic(RELOC("cpu failed to start")); */
+			}
 		}
-		} else {
+#ifdef CONFIG_SMP
+		else {
 			prom_print_hex(cpuid);
 			prom_print(RELOC(" : booting  cpu "));
 			prom_print(path);
@@ -1066,6 +1070,7 @@ prom_hold_cpus(unsigned long mem)
 			}
 			prom_print_nl();
 		}
+#endif
 		cpuid++;
 	}
 #ifdef CONFIG_HMT
diff -puN arch/ppc64/kernel/setup.c~ppc64-UP_cleanup arch/ppc64/kernel/setup.c
--- 25/arch/ppc64/kernel/setup.c~ppc64-UP_cleanup	2004-01-13 23:22:47.000000000 -0800
+++ 25-akpm/arch/ppc64/kernel/setup.c	2004-01-13 23:22:47.000000000 -0800
@@ -194,6 +194,7 @@ void setup_system(unsigned long r3, unsi
 		finish_device_tree();
 		chrp_init(r3, r4, r5, r6, r7);
 
+#ifdef CONFIG_SMP
 		/* Start secondary threads on SMT systems */
 		for (i = 0; i < NR_CPUS; i++) {
 			if(cpu_available(i)  && !cpu_possible(i)) {
@@ -206,6 +207,7 @@ void setup_system(unsigned long r3, unsi
 				systemcfg->processorCount++;
 			}
 		}
+#endif
 	}
 
 	printk("Starting Linux PPC64 %s\n", UTS_RELEASE);
@@ -226,9 +228,11 @@ void setup_system(unsigned long r3, unsi
 
 	mm_init_ppc64();
 
+#ifdef CONFIG_SMP
 	if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
 		vpa_init(boot_cpuid);
 	}
+#endif
 
 	/* Select the correct idle loop for the platform. */
 	idle_setup();
@@ -447,8 +451,7 @@ int parse_bootinfo(void)
 			memcpy(cmd_line, (void *)rec->data, rec->size);
 			break;
 		case BI_SYSMAP:
-			sysmap = (char *)((rec->data[0] >= (KERNELBASE))
-					? rec->data[0] : (unsigned long)__va(rec->data[0]));
+			sysmap = __va(rec->data[0]);
 			sysmap_size = rec->data[1];
 			break;
 #ifdef CONFIG_BLK_DEV_INITRD
diff -puN arch/ppc64/kernel/smp.c~ppc64-UP_cleanup arch/ppc64/kernel/smp.c
--- 25/arch/ppc64/kernel/smp.c~ppc64-UP_cleanup	2004-01-13 23:22:47.000000000 -0800
+++ 25-akpm/arch/ppc64/kernel/smp.c	2004-01-13 23:22:47.000000000 -0800
@@ -60,6 +60,7 @@ cpumask_t cpu_available_map   = CPU_MASK
 cpumask_t cpu_present_at_boot = CPU_MASK_NONE;
 
 EXPORT_SYMBOL(cpu_online_map);
+EXPORT_SYMBOL(cpu_possible_map);
 
 static struct smp_ops_t *smp_ops;
 
@@ -271,7 +272,8 @@ static void __init smp_space_timers(unsi
 }
 
 #ifdef CONFIG_PPC_PSERIES
-void vpa_init(int cpu) {
+void vpa_init(int cpu)
+{
 	unsigned long flags;
 
 	/* Register the Virtual Processor Area (VPA) */
diff -puN include/asm-ppc64/smp.h~ppc64-UP_cleanup include/asm-ppc64/smp.h
--- 25/include/asm-ppc64/smp.h~ppc64-UP_cleanup	2004-01-13 23:22:47.000000000 -0800
+++ 25-akpm/include/asm-ppc64/smp.h	2004-01-13 23:22:47.000000000 -0800
@@ -22,12 +22,12 @@
 #include <linux/cpumask.h>
 #include <linux/kernel.h>
 
-#ifdef CONFIG_SMP
-
 #ifndef __ASSEMBLY__
 
 #include <asm/paca.h>
 
+#ifdef CONFIG_SMP
+
 extern void smp_message_pass(int target, int msg, unsigned long data, int wait);
 extern void smp_send_tlb_invalidate(int);
 extern void smp_send_xmon_break(int cpu);
@@ -69,9 +69,11 @@ extern cpumask_t cpu_available_map;
 void smp_init_iSeries(void);
 void smp_init_pSeries(void);
 
-#endif /* __ASSEMBLY__ */
 #endif /* !(CONFIG_SMP) */
+#endif /* __ASSEMBLY__ */
+
 #define get_hard_smp_processor_id(CPU) (paca[(CPU)].xHwProcNum)
 #define set_hard_smp_processor_id(CPU, VAL) do { (paca[(CPU)].xHwProcNum = VAL); } while (0)
+
 #endif /* !(_PPC64_SMP_H) */
 #endif /* __KERNEL__ */
diff -puN include/linux/proc_fs.h~ppc64-UP_cleanup include/linux/proc_fs.h
--- 25/include/linux/proc_fs.h~ppc64-UP_cleanup	2004-01-13 23:22:47.000000000 -0800
+++ 25-akpm/include/linux/proc_fs.h	2004-01-13 23:22:47.000000000 -0800
@@ -131,6 +131,7 @@ extern void proc_tty_unregister_driver(s
 /*
  * proc_devtree.c
  */
+struct device_node;
 extern void proc_device_tree_init(void);
 extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *);
 

_