diff options
author | Yinghai Lu <yinghai@kernel.org> | 2009-01-29 22:31:49 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-30 09:21:24 -0500 |
commit | 43f39890db2959b10891cf7bbf3f53fffc8ce3bd (patch) | |
tree | 15e3705c14bfaf10eeed3c3220f1ff298e288b8d /arch/x86/include/asm | |
parent | 1ff2f20de354a621ef4b56b9cfe6f9139a7e493b (diff) |
x86: seperate default_send_IPI_mask_sequence/allbutself from logical
Impact: 32-bit should use logical version
there are two version: for default_send_IPI_mask_sequence/allbutself
one in ipi.h and one in ipi.c for 32bit
it seems .h version overwrote ipi.c for a while.
restore it so 32 bit could use its old logical version.
also remove dupicated functions in .c
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r-- | arch/x86/include/asm/ipi.h | 71 |
1 files changed, 60 insertions, 11 deletions
diff --git a/arch/x86/include/asm/ipi.h b/arch/x86/include/asm/ipi.h index e2e8e4e0a656..aa79945445b5 100644 --- a/arch/x86/include/asm/ipi.h +++ b/arch/x86/include/asm/ipi.h | |||
@@ -120,7 +120,7 @@ static inline void | |||
120 | } | 120 | } |
121 | 121 | ||
122 | static inline void | 122 | static inline void |
123 | default_send_IPI_mask_sequence(const struct cpumask *mask, int vector) | 123 | default_send_IPI_mask_sequence_phys(const struct cpumask *mask, int vector) |
124 | { | 124 | { |
125 | unsigned long query_cpu; | 125 | unsigned long query_cpu; |
126 | unsigned long flags; | 126 | unsigned long flags; |
@@ -139,7 +139,7 @@ default_send_IPI_mask_sequence(const struct cpumask *mask, int vector) | |||
139 | } | 139 | } |
140 | 140 | ||
141 | static inline void | 141 | static inline void |
142 | default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector) | 142 | default_send_IPI_mask_allbutself_phys(const struct cpumask *mask, int vector) |
143 | { | 143 | { |
144 | unsigned int this_cpu = smp_processor_id(); | 144 | unsigned int this_cpu = smp_processor_id(); |
145 | unsigned int query_cpu; | 145 | unsigned int query_cpu; |
@@ -157,23 +157,72 @@ default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector) | |||
157 | local_irq_restore(flags); | 157 | local_irq_restore(flags); |
158 | } | 158 | } |
159 | 159 | ||
160 | #include <asm/genapic.h> | ||
161 | |||
162 | static inline void | ||
163 | default_send_IPI_mask_sequence_logical(const struct cpumask *mask, int vector) | ||
164 | { | ||
165 | unsigned long flags; | ||
166 | unsigned int query_cpu; | ||
167 | |||
168 | /* | ||
169 | * Hack. The clustered APIC addressing mode doesn't allow us to send | ||
170 | * to an arbitrary mask, so I do a unicasts to each CPU instead. This | ||
171 | * should be modified to do 1 message per cluster ID - mbligh | ||
172 | */ | ||
173 | |||
174 | local_irq_save(flags); | ||
175 | for_each_cpu(query_cpu, mask) | ||
176 | __default_send_IPI_dest_field( | ||
177 | apic->cpu_to_logical_apicid(query_cpu), vector, | ||
178 | apic->dest_logical); | ||
179 | local_irq_restore(flags); | ||
180 | } | ||
181 | |||
182 | static inline void | ||
183 | default_send_IPI_mask_allbutself_logical(const struct cpumask *mask, int vector) | ||
184 | { | ||
185 | unsigned long flags; | ||
186 | unsigned int query_cpu; | ||
187 | unsigned int this_cpu = smp_processor_id(); | ||
188 | |||
189 | /* See Hack comment above */ | ||
190 | |||
191 | local_irq_save(flags); | ||
192 | for_each_cpu(query_cpu, mask) { | ||
193 | if (query_cpu == this_cpu) | ||
194 | continue; | ||
195 | __default_send_IPI_dest_field( | ||
196 | apic->cpu_to_logical_apicid(query_cpu), vector, | ||
197 | apic->dest_logical); | ||
198 | } | ||
199 | local_irq_restore(flags); | ||
200 | } | ||
160 | 201 | ||
161 | /* Avoid include hell */ | 202 | /* Avoid include hell */ |
162 | #define NMI_VECTOR 0x02 | 203 | #define NMI_VECTOR 0x02 |
163 | 204 | ||
164 | void default_send_IPI_mask_bitmask(const struct cpumask *mask, int vector); | ||
165 | void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector); | ||
166 | |||
167 | extern int no_broadcast; | 205 | extern int no_broadcast; |
168 | 206 | ||
169 | #ifdef CONFIG_X86_64 | 207 | #ifndef CONFIG_X86_64 |
170 | #include <asm/genapic.h> | 208 | /* |
171 | #else | 209 | * This is only used on smaller machines. |
172 | static inline void default_send_IPI_mask(const struct cpumask *mask, int vector) | 210 | */ |
211 | static inline void default_send_IPI_mask_bitmask_logical(const struct cpumask *cpumask, int vector) | ||
212 | { | ||
213 | unsigned long mask = cpumask_bits(cpumask)[0]; | ||
214 | unsigned long flags; | ||
215 | |||
216 | local_irq_save(flags); | ||
217 | WARN_ON(mask & ~cpumask_bits(cpu_online_mask)[0]); | ||
218 | __default_send_IPI_dest_field(mask, vector, apic->dest_logical); | ||
219 | local_irq_restore(flags); | ||
220 | } | ||
221 | |||
222 | static inline void default_send_IPI_mask_logical(const struct cpumask *mask, int vector) | ||
173 | { | 223 | { |
174 | default_send_IPI_mask_bitmask(mask, vector); | 224 | default_send_IPI_mask_bitmask_logical(mask, vector); |
175 | } | 225 | } |
176 | void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector); | ||
177 | #endif | 226 | #endif |
178 | 227 | ||
179 | static inline void __default_local_send_IPI_allbutself(int vector) | 228 | static inline void __default_local_send_IPI_allbutself(int vector) |