aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/mach-default/mach_ipi.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86/mach-default/mach_ipi.h')
-rw-r--r--include/asm-x86/mach-default/mach_ipi.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/include/asm-x86/mach-default/mach_ipi.h b/include/asm-x86/mach-default/mach_ipi.h
new file mode 100644
index 000000000000..0dba244c86db
--- /dev/null
+++ b/include/asm-x86/mach-default/mach_ipi.h
@@ -0,0 +1,54 @@
1#ifndef __ASM_MACH_IPI_H
2#define __ASM_MACH_IPI_H
3
4/* Avoid include hell */
5#define NMI_VECTOR 0x02
6
7void send_IPI_mask_bitmask(cpumask_t mask, int vector);
8void __send_IPI_shortcut(unsigned int shortcut, int vector);
9
10extern int no_broadcast;
11
12static inline void send_IPI_mask(cpumask_t mask, int vector)
13{
14 send_IPI_mask_bitmask(mask, vector);
15}
16
17static inline void __local_send_IPI_allbutself(int vector)
18{
19 if (no_broadcast || vector == NMI_VECTOR) {
20 cpumask_t mask = cpu_online_map;
21
22 cpu_clear(smp_processor_id(), mask);
23 send_IPI_mask(mask, vector);
24 } else
25 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
26}
27
28static inline void __local_send_IPI_all(int vector)
29{
30 if (no_broadcast || vector == NMI_VECTOR)
31 send_IPI_mask(cpu_online_map, vector);
32 else
33 __send_IPI_shortcut(APIC_DEST_ALLINC, vector);
34}
35
36static inline void send_IPI_allbutself(int vector)
37{
38 /*
39 * if there are no other CPUs in the system then we get an APIC send
40 * error if we try to broadcast, thus avoid sending IPIs in this case.
41 */
42 if (!(num_online_cpus() > 1))
43 return;
44
45 __local_send_IPI_allbutself(vector);
46 return;
47}
48
49static inline void send_IPI_all(int vector)
50{
51 __local_send_IPI_all(vector);
52}
53
54#endif /* __ASM_MACH_IPI_H */