Linux 2.6.26-rc5
[linux-2.6/openmoko-kernel/knife-kernel.git] / include / asm-x86 / mach-default / mach_ipi.h
blobbe323364e68f6d7522194f7b2d2941df8edd6d19
1 #ifndef __ASM_MACH_IPI_H
2 #define __ASM_MACH_IPI_H
4 /* Avoid include hell */
5 #define NMI_VECTOR 0x02
7 void send_IPI_mask_bitmask(cpumask_t mask, int vector);
8 void __send_IPI_shortcut(unsigned int shortcut, int vector);
10 extern int no_broadcast;
12 #ifdef CONFIG_X86_64
13 #include <asm/genapic.h>
14 #define send_IPI_mask (genapic->send_IPI_mask)
15 #else
16 static inline void send_IPI_mask(cpumask_t mask, int vector)
18 send_IPI_mask_bitmask(mask, vector);
20 #endif
22 static inline void __local_send_IPI_allbutself(int vector)
24 if (no_broadcast || vector == NMI_VECTOR) {
25 cpumask_t mask = cpu_online_map;
27 cpu_clear(smp_processor_id(), mask);
28 send_IPI_mask(mask, vector);
29 } else
30 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
33 static inline void __local_send_IPI_all(int vector)
35 if (no_broadcast || vector == NMI_VECTOR)
36 send_IPI_mask(cpu_online_map, vector);
37 else
38 __send_IPI_shortcut(APIC_DEST_ALLINC, vector);
41 #ifdef CONFIG_X86_64
42 #define send_IPI_allbutself (genapic->send_IPI_allbutself)
43 #define send_IPI_all (genapic->send_IPI_all)
44 #else
45 static inline void send_IPI_allbutself(int vector)
48 * if there are no other CPUs in the system then we get an APIC send
49 * error if we try to broadcast, thus avoid sending IPIs in this case.
51 if (!(num_online_cpus() > 1))
52 return;
54 __local_send_IPI_allbutself(vector);
55 return;
58 static inline void send_IPI_all(int vector)
60 __local_send_IPI_all(vector);
62 #endif
64 #endif /* __ASM_MACH_IPI_H */