diff options
author | Anton Blanchard <anton@samba.org> | 2010-04-26 11:32:41 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-05-06 03:41:56 -0400 |
commit | cc1ba8ea6dde3f049b2b365d8fdc13976aee25cb (patch) | |
tree | 89276abd9b89c39967a04ec39dcfc1ca2a924f6d /arch/powerpc/include | |
parent | e6532c63cc3dbefc79936fc9c9c68a151004fe46 (diff) |
powerpc/cpumask: Dynamically allocate cpu_sibling_map and cpu_core_map cpumasks
Dynamically allocate cpu_sibling_map and cpu_core_map cpumasks.
We don't need to set_cpu_online() the boot cpu in smp_prepare_boot_cpu,
init/main.c does it for us.
We also postpone setting of the boot cpu in cpu_sibling_map and cpu_core_map
until when the memory allocator is available (smp_prepare_cpus), similar
to x86.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r-- | arch/powerpc/include/asm/smp.h | 16 | ||||
-rw-r--r-- | arch/powerpc/include/asm/topology.h | 4 |
2 files changed, 15 insertions, 5 deletions
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h index 4d332296c40d..66e237bbe15f 100644 --- a/arch/powerpc/include/asm/smp.h +++ b/arch/powerpc/include/asm/smp.h | |||
@@ -68,8 +68,19 @@ static inline void set_hard_smp_processor_id(int cpu, int phys) | |||
68 | } | 68 | } |
69 | #endif | 69 | #endif |
70 | 70 | ||
71 | DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); | 71 | DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_map); |
72 | DECLARE_PER_CPU(cpumask_t, cpu_core_map); | 72 | DECLARE_PER_CPU(cpumask_var_t, cpu_core_map); |
73 | |||
74 | static inline struct cpumask *cpu_sibling_mask(int cpu) | ||
75 | { | ||
76 | return per_cpu(cpu_sibling_map, cpu); | ||
77 | } | ||
78 | |||
79 | static inline struct cpumask *cpu_core_mask(int cpu) | ||
80 | { | ||
81 | return per_cpu(cpu_core_map, cpu); | ||
82 | } | ||
83 | |||
73 | extern int cpu_to_core_id(int cpu); | 84 | extern int cpu_to_core_id(int cpu); |
74 | 85 | ||
75 | /* Since OpenPIC has only 4 IPIs, we use slightly different message numbers. | 86 | /* Since OpenPIC has only 4 IPIs, we use slightly different message numbers. |
@@ -93,7 +104,6 @@ void smp_init_pSeries(void); | |||
93 | void smp_init_cell(void); | 104 | void smp_init_cell(void); |
94 | void smp_init_celleb(void); | 105 | void smp_init_celleb(void); |
95 | void smp_setup_cpu_maps(void); | 106 | void smp_setup_cpu_maps(void); |
96 | void smp_setup_cpu_sibling_map(void); | ||
97 | 107 | ||
98 | extern int __cpu_disable(void); | 108 | extern int __cpu_disable(void); |
99 | extern void __cpu_die(unsigned int cpu); | 109 | extern void __cpu_die(unsigned int cpu); |
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h index a7d769491555..789599b69960 100644 --- a/arch/powerpc/include/asm/topology.h +++ b/arch/powerpc/include/asm/topology.h | |||
@@ -112,8 +112,8 @@ static inline void sysfs_remove_device_from_node(struct sys_device *dev, | |||
112 | #ifdef CONFIG_PPC64 | 112 | #ifdef CONFIG_PPC64 |
113 | #include <asm/smp.h> | 113 | #include <asm/smp.h> |
114 | 114 | ||
115 | #define topology_thread_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu)) | 115 | #define topology_thread_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu)) |
116 | #define topology_core_cpumask(cpu) (&per_cpu(cpu_core_map, cpu)) | 116 | #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu)) |
117 | #define topology_core_id(cpu) (cpu_to_core_id(cpu)) | 117 | #define topology_core_id(cpu) (cpu_to_core_id(cpu)) |
118 | #endif | 118 | #endif |
119 | #endif | 119 | #endif |