Commit 54fec6c4 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ppc64: UP compile fixes, from Paul Mackerras

From: Anton Blanchard <anton@samba.org>

Minor fixes to make the UP case compile, export cpu_possible_map, fix up
whitespace etc.
parent 09a0a191
...@@ -1029,18 +1029,22 @@ prom_hold_cpus(unsigned long mem) ...@@ -1029,18 +1029,22 @@ prom_hold_cpus(unsigned long mem)
if (*acknowledge == cpuid) { if (*acknowledge == cpuid) {
prom_print(RELOC("ok\n")); prom_print(RELOC("ok\n"));
#ifdef CONFIG_SMP
/* Set the number of active processors. */ /* Set the number of active processors. */
_systemcfg->processorCount++; _systemcfg->processorCount++;
cpu_set(cpuid, RELOC(cpu_available_map)); cpu_set(cpuid, RELOC(cpu_available_map));
cpu_set(cpuid, RELOC(cpu_possible_map)); cpu_set(cpuid, RELOC(cpu_possible_map));
cpu_set(cpuid, RELOC(cpu_present_at_boot)); cpu_set(cpuid, RELOC(cpu_present_at_boot));
#endif
} else { } else {
prom_print(RELOC("failed: ")); prom_print(RELOC("failed: "));
prom_print_hex(*acknowledge); prom_print_hex(*acknowledge);
prom_print_nl(); prom_print_nl();
/* prom_panic(RELOC("cpu failed to start")); */ /* prom_panic(RELOC("cpu failed to start")); */
} }
} else { }
#ifdef CONFIG_SMP
else {
prom_print_hex(cpuid); prom_print_hex(cpuid);
prom_print(RELOC(" : booting cpu ")); prom_print(RELOC(" : booting cpu "));
prom_print(path); prom_print(path);
...@@ -1066,6 +1070,7 @@ prom_hold_cpus(unsigned long mem) ...@@ -1066,6 +1070,7 @@ prom_hold_cpus(unsigned long mem)
} }
prom_print_nl(); prom_print_nl();
} }
#endif
cpuid++; cpuid++;
} }
#ifdef CONFIG_HMT #ifdef CONFIG_HMT
......
...@@ -194,6 +194,7 @@ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -194,6 +194,7 @@ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5,
finish_device_tree(); finish_device_tree();
chrp_init(r3, r4, r5, r6, r7); chrp_init(r3, r4, r5, r6, r7);
#ifdef CONFIG_SMP
/* Start secondary threads on SMT systems */ /* Start secondary threads on SMT systems */
for (i = 0; i < NR_CPUS; i++) { for (i = 0; i < NR_CPUS; i++) {
if(cpu_available(i) && !cpu_possible(i)) { if(cpu_available(i) && !cpu_possible(i)) {
...@@ -206,6 +207,7 @@ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -206,6 +207,7 @@ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5,
systemcfg->processorCount++; systemcfg->processorCount++;
} }
} }
#endif
} }
printk("Starting Linux PPC64 %s\n", UTS_RELEASE); printk("Starting Linux PPC64 %s\n", UTS_RELEASE);
...@@ -226,9 +228,11 @@ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -226,9 +228,11 @@ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5,
mm_init_ppc64(); mm_init_ppc64();
#ifdef CONFIG_SMP
if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) { if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
vpa_init(boot_cpuid); vpa_init(boot_cpuid);
} }
#endif
/* Select the correct idle loop for the platform. */ /* Select the correct idle loop for the platform. */
idle_setup(); idle_setup();
...@@ -447,8 +451,7 @@ int parse_bootinfo(void) ...@@ -447,8 +451,7 @@ int parse_bootinfo(void)
memcpy(cmd_line, (void *)rec->data, rec->size); memcpy(cmd_line, (void *)rec->data, rec->size);
break; break;
case BI_SYSMAP: case BI_SYSMAP:
sysmap = (char *)((rec->data[0] >= (KERNELBASE)) sysmap = __va(rec->data[0]);
? rec->data[0] : (unsigned long)__va(rec->data[0]));
sysmap_size = rec->data[1]; sysmap_size = rec->data[1];
break; break;
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
......
...@@ -60,6 +60,7 @@ cpumask_t cpu_available_map = CPU_MASK_NONE; ...@@ -60,6 +60,7 @@ cpumask_t cpu_available_map = CPU_MASK_NONE;
cpumask_t cpu_present_at_boot = CPU_MASK_NONE; cpumask_t cpu_present_at_boot = CPU_MASK_NONE;
EXPORT_SYMBOL(cpu_online_map); EXPORT_SYMBOL(cpu_online_map);
EXPORT_SYMBOL(cpu_possible_map);
static struct smp_ops_t *smp_ops; static struct smp_ops_t *smp_ops;
...@@ -271,7 +272,8 @@ static void __init smp_space_timers(unsigned int max_cpus) ...@@ -271,7 +272,8 @@ static void __init smp_space_timers(unsigned int max_cpus)
} }
#ifdef CONFIG_PPC_PSERIES #ifdef CONFIG_PPC_PSERIES
void vpa_init(int cpu) { void vpa_init(int cpu)
{
unsigned long flags; unsigned long flags;
/* Register the Virtual Processor Area (VPA) */ /* Register the Virtual Processor Area (VPA) */
......
...@@ -22,12 +22,12 @@ ...@@ -22,12 +22,12 @@
#include <linux/cpumask.h> #include <linux/cpumask.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#ifdef CONFIG_SMP
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <asm/paca.h> #include <asm/paca.h>
#ifdef CONFIG_SMP
extern void smp_message_pass(int target, int msg, unsigned long data, int wait); 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_tlb_invalidate(int);
extern void smp_send_xmon_break(int cpu); extern void smp_send_xmon_break(int cpu);
...@@ -69,9 +69,11 @@ extern cpumask_t cpu_available_map; ...@@ -69,9 +69,11 @@ extern cpumask_t cpu_available_map;
void smp_init_iSeries(void); void smp_init_iSeries(void);
void smp_init_pSeries(void); void smp_init_pSeries(void);
#endif /* __ASSEMBLY__ */
#endif /* !(CONFIG_SMP) */ #endif /* !(CONFIG_SMP) */
#endif /* __ASSEMBLY__ */
#define get_hard_smp_processor_id(CPU) (paca[(CPU)].xHwProcNum) #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) #define set_hard_smp_processor_id(CPU, VAL) do { (paca[(CPU)].xHwProcNum = VAL); } while (0)
#endif /* !(_PPC64_SMP_H) */ #endif /* !(_PPC64_SMP_H) */
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
...@@ -131,6 +131,7 @@ extern void proc_tty_unregister_driver(struct tty_driver *driver); ...@@ -131,6 +131,7 @@ extern void proc_tty_unregister_driver(struct tty_driver *driver);
/* /*
* proc_devtree.c * proc_devtree.c
*/ */
struct device_node;
extern void proc_device_tree_init(void); extern void proc_device_tree_init(void);
extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *); extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *);
......
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