H. Peter Anvin | 05e4d31 | 2008-10-23 00:01:39 -0700 | [diff] [blame] | 1 | #ifndef _ASM_X86_MACH_DEFAULT_MACH_IPI_H |
| 2 | #define _ASM_X86_MACH_DEFAULT_MACH_IPI_H |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | |
Keith Owens | e77deac | 2006-06-26 13:59:56 +0200 | [diff] [blame] | 4 | /* Avoid include hell */ |
| 5 | #define NMI_VECTOR 0x02 |
| 6 | |
Ingo Molnar | dac5f41 | 2009-01-28 15:42:24 +0100 | [diff] [blame] | 7 | void default_send_IPI_mask_bitmask(const struct cpumask *mask, int vector); |
| 8 | void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector); |
| 9 | void __default_send_IPI_shortcut(unsigned int shortcut, int vector); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | |
Ashok Raj | 67664c8 | 2005-06-25 14:54:52 -0700 | [diff] [blame] | 11 | extern int no_broadcast; |
| 12 | |
Glauber Costa | 5af5573 | 2008-03-25 13:28:56 -0300 | [diff] [blame] | 13 | #ifdef CONFIG_X86_64 |
| 14 | #include <asm/genapic.h> |
Glauber Costa | 5af5573 | 2008-03-25 13:28:56 -0300 | [diff] [blame] | 15 | #else |
Ingo Molnar | dac5f41 | 2009-01-28 15:42:24 +0100 | [diff] [blame] | 16 | static inline void default_send_IPI_mask(const struct cpumask *mask, int vector) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | { |
Ingo Molnar | dac5f41 | 2009-01-28 15:42:24 +0100 | [diff] [blame] | 18 | default_send_IPI_mask_bitmask(mask, vector); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | } |
Ingo Molnar | dac5f41 | 2009-01-28 15:42:24 +0100 | [diff] [blame] | 20 | void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector); |
Glauber Costa | 5af5573 | 2008-03-25 13:28:56 -0300 | [diff] [blame] | 21 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | |
Ingo Molnar | dac5f41 | 2009-01-28 15:42:24 +0100 | [diff] [blame] | 23 | static inline void __default_local_send_IPI_allbutself(int vector) |
Ashok Raj | 67664c8 | 2005-06-25 14:54:52 -0700 | [diff] [blame] | 24 | { |
Mike Travis | e798673 | 2008-12-16 17:33:52 -0800 | [diff] [blame] | 25 | if (no_broadcast || vector == NMI_VECTOR) |
Ingo Molnar | dac5f41 | 2009-01-28 15:42:24 +0100 | [diff] [blame] | 26 | apic->send_IPI_mask_allbutself(cpu_online_mask, vector); |
Mike Travis | e798673 | 2008-12-16 17:33:52 -0800 | [diff] [blame] | 27 | else |
Ingo Molnar | dac5f41 | 2009-01-28 15:42:24 +0100 | [diff] [blame] | 28 | __default_send_IPI_shortcut(APIC_DEST_ALLBUT, vector); |
Ashok Raj | 67664c8 | 2005-06-25 14:54:52 -0700 | [diff] [blame] | 29 | } |
| 30 | |
Ingo Molnar | dac5f41 | 2009-01-28 15:42:24 +0100 | [diff] [blame] | 31 | static inline void __default_local_send_IPI_all(int vector) |
Ashok Raj | 67664c8 | 2005-06-25 14:54:52 -0700 | [diff] [blame] | 32 | { |
Keith Owens | e77deac | 2006-06-26 13:59:56 +0200 | [diff] [blame] | 33 | if (no_broadcast || vector == NMI_VECTOR) |
Ingo Molnar | dac5f41 | 2009-01-28 15:42:24 +0100 | [diff] [blame] | 34 | apic->send_IPI_mask(cpu_online_mask, vector); |
Ashok Raj | 67664c8 | 2005-06-25 14:54:52 -0700 | [diff] [blame] | 35 | else |
Ingo Molnar | dac5f41 | 2009-01-28 15:42:24 +0100 | [diff] [blame] | 36 | __default_send_IPI_shortcut(APIC_DEST_ALLINC, vector); |
Ashok Raj | 67664c8 | 2005-06-25 14:54:52 -0700 | [diff] [blame] | 37 | } |
| 38 | |
Ingo Molnar | dac5f41 | 2009-01-28 15:42:24 +0100 | [diff] [blame] | 39 | #ifdef CONFIG_X86_32 |
| 40 | static inline void default_send_IPI_allbutself(int vector) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | { |
| 42 | /* |
| 43 | * if there are no other CPUs in the system then we get an APIC send |
| 44 | * error if we try to broadcast, thus avoid sending IPIs in this case. |
| 45 | */ |
| 46 | if (!(num_online_cpus() > 1)) |
| 47 | return; |
| 48 | |
Ingo Molnar | dac5f41 | 2009-01-28 15:42:24 +0100 | [diff] [blame] | 49 | __default_local_send_IPI_allbutself(vector); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | } |
| 51 | |
Ingo Molnar | dac5f41 | 2009-01-28 15:42:24 +0100 | [diff] [blame] | 52 | static inline void default_send_IPI_all(int vector) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | { |
Ingo Molnar | dac5f41 | 2009-01-28 15:42:24 +0100 | [diff] [blame] | 54 | __default_local_send_IPI_all(vector); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | } |
Glauber Costa | 5af5573 | 2008-03-25 13:28:56 -0300 | [diff] [blame] | 56 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | |
H. Peter Anvin | 05e4d31 | 2008-10-23 00:01:39 -0700 | [diff] [blame] | 58 | #endif /* _ASM_X86_MACH_DEFAULT_MACH_IPI_H */ |