blob: a1d0072e36bc8f9fc15163544b2c374db789527a [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef __ASM_MACH_IPI_H
2#define __ASM_MACH_IPI_H
3
4void send_IPI_mask_bitmask(cpumask_t mask, int vector);
5void __send_IPI_shortcut(unsigned int shortcut, int vector);
6
Ashok Raj67664c82005-06-25 14:54:52 -07007extern int no_broadcast;
8
Linus Torvalds1da177e2005-04-16 15:20:36 -07009static inline void send_IPI_mask(cpumask_t mask, int vector)
10{
11 send_IPI_mask_bitmask(mask, vector);
12}
13
Ashok Raj67664c82005-06-25 14:54:52 -070014static inline void __local_send_IPI_allbutself(int vector)
15{
16 if (no_broadcast) {
17 cpumask_t mask = cpu_online_map;
Ashok Raj67664c82005-06-25 14:54:52 -070018
Zwane Mwaikambo329d4002006-01-11 22:43:09 +010019 cpu_clear(smp_processor_id(), mask);
Ashok Raj67664c82005-06-25 14:54:52 -070020 send_IPI_mask(mask, vector);
Ashok Raj67664c82005-06-25 14:54:52 -070021 } else
22 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
23}
24
25static inline void __local_send_IPI_all(int vector)
26{
27 if (no_broadcast)
28 send_IPI_mask(cpu_online_map, vector);
29 else
30 __send_IPI_shortcut(APIC_DEST_ALLINC, vector);
31}
32
Linus Torvalds1da177e2005-04-16 15:20:36 -070033static inline void send_IPI_allbutself(int vector)
34{
35 /*
36 * if there are no other CPUs in the system then we get an APIC send
37 * error if we try to broadcast, thus avoid sending IPIs in this case.
38 */
39 if (!(num_online_cpus() > 1))
40 return;
41
Ashok Raj67664c82005-06-25 14:54:52 -070042 __local_send_IPI_allbutself(vector);
Linus Torvalds1da177e2005-04-16 15:20:36 -070043 return;
44}
45
46static inline void send_IPI_all(int vector)
47{
Ashok Raj67664c82005-06-25 14:54:52 -070048 __local_send_IPI_all(vector);
Linus Torvalds1da177e2005-04-16 15:20:36 -070049}
50
51#endif /* __ASM_MACH_IPI_H */