diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-01-28 13:14:52 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-29 08:16:49 -0500 |
commit | d53e2f2855f1c7c2725d550c1ae6b26f4d671c50 (patch) | |
tree | f749e169c6b8099428cb3aa3f0aa1412ce6e1a17 /arch/x86/include/asm/ipi.h | |
parent | 9f4187f0a3b93fc215b4472063b6c0b44364e60c (diff) |
x86, smp: remove mach_ipi.h
Move mach_ipi.h definitions into genapic.h.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/include/asm/ipi.h')
-rw-r--r-- | arch/x86/include/asm/ipi.h | 61 |
1 files changed, 59 insertions, 2 deletions
diff --git a/arch/x86/include/asm/ipi.h b/arch/x86/include/asm/ipi.h index a8d717f2c7e7..e2e8e4e0a656 100644 --- a/arch/x86/include/asm/ipi.h +++ b/arch/x86/include/asm/ipi.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _ASM_X86_IPI_H | 1 | #ifndef _ASM_X86_IPI_H |
2 | #define _ASM_X86_IPI_H | 2 | #define _ASM_X86_IPI_H |
3 | 3 | ||
4 | #ifdef CONFIG_X86_LOCAL_APIC | ||
5 | |||
4 | /* | 6 | /* |
5 | * Copyright 2004 James Cleverdon, IBM. | 7 | * Copyright 2004 James Cleverdon, IBM. |
6 | * Subject to the GNU Public License, v.2 | 8 | * Subject to the GNU Public License, v.2 |
@@ -56,8 +58,7 @@ static inline void __xapic_wait_icr_idle(void) | |||
56 | } | 58 | } |
57 | 59 | ||
58 | static inline void | 60 | static inline void |
59 | __default_send_IPI_shortcut(unsigned int shortcut, | 61 | __default_send_IPI_shortcut(unsigned int shortcut, int vector, unsigned int dest) |
60 | int vector, unsigned int dest) | ||
61 | { | 62 | { |
62 | /* | 63 | /* |
63 | * Subtle. In the case of the 'never do double writes' workaround | 64 | * Subtle. In the case of the 'never do double writes' workaround |
@@ -156,4 +157,60 @@ default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector) | |||
156 | local_irq_restore(flags); | 157 | local_irq_restore(flags); |
157 | } | 158 | } |
158 | 159 | ||
160 | |||
161 | /* Avoid include hell */ | ||
162 | #define NMI_VECTOR 0x02 | ||
163 | |||
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; | ||
168 | |||
169 | #ifdef CONFIG_X86_64 | ||
170 | #include <asm/genapic.h> | ||
171 | #else | ||
172 | static inline void default_send_IPI_mask(const struct cpumask *mask, int vector) | ||
173 | { | ||
174 | default_send_IPI_mask_bitmask(mask, vector); | ||
175 | } | ||
176 | void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector); | ||
177 | #endif | ||
178 | |||
179 | static inline void __default_local_send_IPI_allbutself(int vector) | ||
180 | { | ||
181 | if (no_broadcast || vector == NMI_VECTOR) | ||
182 | apic->send_IPI_mask_allbutself(cpu_online_mask, vector); | ||
183 | else | ||
184 | __default_send_IPI_shortcut(APIC_DEST_ALLBUT, vector, apic->dest_logical); | ||
185 | } | ||
186 | |||
187 | static inline void __default_local_send_IPI_all(int vector) | ||
188 | { | ||
189 | if (no_broadcast || vector == NMI_VECTOR) | ||
190 | apic->send_IPI_mask(cpu_online_mask, vector); | ||
191 | else | ||
192 | __default_send_IPI_shortcut(APIC_DEST_ALLINC, vector, apic->dest_logical); | ||
193 | } | ||
194 | |||
195 | #ifdef CONFIG_X86_32 | ||
196 | static inline void default_send_IPI_allbutself(int vector) | ||
197 | { | ||
198 | /* | ||
199 | * if there are no other CPUs in the system then we get an APIC send | ||
200 | * error if we try to broadcast, thus avoid sending IPIs in this case. | ||
201 | */ | ||
202 | if (!(num_online_cpus() > 1)) | ||
203 | return; | ||
204 | |||
205 | __default_local_send_IPI_allbutself(vector); | ||
206 | } | ||
207 | |||
208 | static inline void default_send_IPI_all(int vector) | ||
209 | { | ||
210 | __default_local_send_IPI_all(vector); | ||
211 | } | ||
212 | #endif | ||
213 | |||
214 | #endif | ||
215 | |||
159 | #endif /* _ASM_X86_IPI_H */ | 216 | #endif /* _ASM_X86_IPI_H */ |