diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-01-28 09:42:24 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-28 17:20:31 -0500 |
commit | dac5f4121df3c39fdb2ea57acd669a0ae19e46f8 (patch) | |
tree | c3dde8b525b1a8e73732bdffdb7e819f4a14fd3a /arch/x86/include/asm/ipi.h | |
parent | debccb3e77be52cfc26c5a99e123c114c5c72aeb (diff) |
x86, apic: untangle the send_IPI_*() jungle
Our send_IPI_*() methods and definitions are a twisted mess: the same
symbol is defined to different things depending on .config details,
in a non-transparent way.
- spread out the quirks into separately named per apic driver methods
- prefix the standard PC methods with default_
- get rid of wrapper macro obfuscation
- clean up various details
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 | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/arch/x86/include/asm/ipi.h b/arch/x86/include/asm/ipi.h index c745a306f7d3..a8d717f2c7e7 100644 --- a/arch/x86/include/asm/ipi.h +++ b/arch/x86/include/asm/ipi.h | |||
@@ -55,8 +55,9 @@ static inline void __xapic_wait_icr_idle(void) | |||
55 | cpu_relax(); | 55 | cpu_relax(); |
56 | } | 56 | } |
57 | 57 | ||
58 | static inline void __send_IPI_shortcut(unsigned int shortcut, int vector, | 58 | static inline void |
59 | unsigned int dest) | 59 | __default_send_IPI_shortcut(unsigned int shortcut, |
60 | int vector, unsigned int dest) | ||
60 | { | 61 | { |
61 | /* | 62 | /* |
62 | * Subtle. In the case of the 'never do double writes' workaround | 63 | * Subtle. In the case of the 'never do double writes' workaround |
@@ -87,8 +88,8 @@ static inline void __send_IPI_shortcut(unsigned int shortcut, int vector, | |||
87 | * This is used to send an IPI with no shorthand notation (the destination is | 88 | * This is used to send an IPI with no shorthand notation (the destination is |
88 | * specified in bits 56 to 63 of the ICR). | 89 | * specified in bits 56 to 63 of the ICR). |
89 | */ | 90 | */ |
90 | static inline void __send_IPI_dest_field(unsigned int mask, int vector, | 91 | static inline void |
91 | unsigned int dest) | 92 | __default_send_IPI_dest_field(unsigned int mask, int vector, unsigned int dest) |
92 | { | 93 | { |
93 | unsigned long cfg; | 94 | unsigned long cfg; |
94 | 95 | ||
@@ -117,11 +118,11 @@ static inline void __send_IPI_dest_field(unsigned int mask, int vector, | |||
117 | native_apic_mem_write(APIC_ICR, cfg); | 118 | native_apic_mem_write(APIC_ICR, cfg); |
118 | } | 119 | } |
119 | 120 | ||
120 | static inline void send_IPI_mask_sequence(const struct cpumask *mask, | 121 | static inline void |
121 | int vector) | 122 | default_send_IPI_mask_sequence(const struct cpumask *mask, int vector) |
122 | { | 123 | { |
123 | unsigned long flags; | ||
124 | unsigned long query_cpu; | 124 | unsigned long query_cpu; |
125 | unsigned long flags; | ||
125 | 126 | ||
126 | /* | 127 | /* |
127 | * Hack. The clustered APIC addressing mode doesn't allow us to send | 128 | * Hack. The clustered APIC addressing mode doesn't allow us to send |
@@ -130,27 +131,28 @@ static inline void send_IPI_mask_sequence(const struct cpumask *mask, | |||
130 | */ | 131 | */ |
131 | local_irq_save(flags); | 132 | local_irq_save(flags); |
132 | for_each_cpu(query_cpu, mask) { | 133 | for_each_cpu(query_cpu, mask) { |
133 | __send_IPI_dest_field(per_cpu(x86_cpu_to_apicid, query_cpu), | 134 | __default_send_IPI_dest_field(per_cpu(x86_cpu_to_apicid, |
134 | vector, APIC_DEST_PHYSICAL); | 135 | query_cpu), vector, APIC_DEST_PHYSICAL); |
135 | } | 136 | } |
136 | local_irq_restore(flags); | 137 | local_irq_restore(flags); |
137 | } | 138 | } |
138 | 139 | ||
139 | static inline void send_IPI_mask_allbutself(const struct cpumask *mask, | 140 | static inline void |
140 | int vector) | 141 | default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector) |
141 | { | 142 | { |
142 | unsigned long flags; | ||
143 | unsigned int query_cpu; | ||
144 | unsigned int this_cpu = smp_processor_id(); | 143 | unsigned int this_cpu = smp_processor_id(); |
144 | unsigned int query_cpu; | ||
145 | unsigned long flags; | ||
145 | 146 | ||
146 | /* See Hack comment above */ | 147 | /* See Hack comment above */ |
147 | 148 | ||
148 | local_irq_save(flags); | 149 | local_irq_save(flags); |
149 | for_each_cpu(query_cpu, mask) | 150 | for_each_cpu(query_cpu, mask) { |
150 | if (query_cpu != this_cpu) | 151 | if (query_cpu == this_cpu) |
151 | __send_IPI_dest_field( | 152 | continue; |
152 | per_cpu(x86_cpu_to_apicid, query_cpu), | 153 | __default_send_IPI_dest_field(per_cpu(x86_cpu_to_apicid, |
153 | vector, APIC_DEST_PHYSICAL); | 154 | query_cpu), vector, APIC_DEST_PHYSICAL); |
155 | } | ||
154 | local_irq_restore(flags); | 156 | local_irq_restore(flags); |
155 | } | 157 | } |
156 | 158 | ||