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/kernel/genx2apic_cluster.c | |
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/kernel/genx2apic_cluster.c')
-rw-r--r-- | arch/x86/kernel/genx2apic_cluster.c | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/genx2apic_cluster.c index 62f9fccf01dd..2d97726a973e 100644 --- a/arch/x86/kernel/genx2apic_cluster.c +++ b/arch/x86/kernel/genx2apic_cluster.c | |||
@@ -36,8 +36,8 @@ static void x2apic_vector_allocation_domain(int cpu, struct cpumask *retmask) | |||
36 | cpumask_set_cpu(cpu, retmask); | 36 | cpumask_set_cpu(cpu, retmask); |
37 | } | 37 | } |
38 | 38 | ||
39 | static void __x2apic_send_IPI_dest(unsigned int apicid, int vector, | 39 | static void |
40 | unsigned int dest) | 40 | __x2apic_send_IPI_dest(unsigned int apicid, int vector, unsigned int dest) |
41 | { | 41 | { |
42 | unsigned long cfg; | 42 | unsigned long cfg; |
43 | 43 | ||
@@ -57,45 +57,50 @@ static void __x2apic_send_IPI_dest(unsigned int apicid, int vector, | |||
57 | */ | 57 | */ |
58 | static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector) | 58 | static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector) |
59 | { | 59 | { |
60 | unsigned long flags; | ||
61 | unsigned long query_cpu; | 60 | unsigned long query_cpu; |
61 | unsigned long flags; | ||
62 | 62 | ||
63 | local_irq_save(flags); | 63 | local_irq_save(flags); |
64 | for_each_cpu(query_cpu, mask) | 64 | for_each_cpu(query_cpu, mask) { |
65 | __x2apic_send_IPI_dest( | 65 | __x2apic_send_IPI_dest( |
66 | per_cpu(x86_cpu_to_logical_apicid, query_cpu), | 66 | per_cpu(x86_cpu_to_logical_apicid, query_cpu), |
67 | vector, apic->dest_logical); | 67 | vector, apic->dest_logical); |
68 | } | ||
68 | local_irq_restore(flags); | 69 | local_irq_restore(flags); |
69 | } | 70 | } |
70 | 71 | ||
71 | static void x2apic_send_IPI_mask_allbutself(const struct cpumask *mask, | 72 | static void |
72 | int vector) | 73 | x2apic_send_IPI_mask_allbutself(const struct cpumask *mask, int vector) |
73 | { | 74 | { |
74 | unsigned long flags; | ||
75 | unsigned long query_cpu; | ||
76 | unsigned long this_cpu = smp_processor_id(); | 75 | unsigned long this_cpu = smp_processor_id(); |
76 | unsigned long query_cpu; | ||
77 | unsigned long flags; | ||
77 | 78 | ||
78 | local_irq_save(flags); | 79 | local_irq_save(flags); |
79 | for_each_cpu(query_cpu, mask) | 80 | for_each_cpu(query_cpu, mask) { |
80 | if (query_cpu != this_cpu) | 81 | if (query_cpu == this_cpu) |
81 | __x2apic_send_IPI_dest( | 82 | continue; |
83 | __x2apic_send_IPI_dest( | ||
82 | per_cpu(x86_cpu_to_logical_apicid, query_cpu), | 84 | per_cpu(x86_cpu_to_logical_apicid, query_cpu), |
83 | vector, apic->dest_logical); | 85 | vector, apic->dest_logical); |
86 | } | ||
84 | local_irq_restore(flags); | 87 | local_irq_restore(flags); |
85 | } | 88 | } |
86 | 89 | ||
87 | static void x2apic_send_IPI_allbutself(int vector) | 90 | static void x2apic_send_IPI_allbutself(int vector) |
88 | { | 91 | { |
89 | unsigned long flags; | ||
90 | unsigned long query_cpu; | ||
91 | unsigned long this_cpu = smp_processor_id(); | 92 | unsigned long this_cpu = smp_processor_id(); |
93 | unsigned long query_cpu; | ||
94 | unsigned long flags; | ||
92 | 95 | ||
93 | local_irq_save(flags); | 96 | local_irq_save(flags); |
94 | for_each_online_cpu(query_cpu) | 97 | for_each_online_cpu(query_cpu) { |
95 | if (query_cpu != this_cpu) | 98 | if (query_cpu == this_cpu) |
96 | __x2apic_send_IPI_dest( | 99 | continue; |
100 | __x2apic_send_IPI_dest( | ||
97 | per_cpu(x86_cpu_to_logical_apicid, query_cpu), | 101 | per_cpu(x86_cpu_to_logical_apicid, query_cpu), |
98 | vector, apic->dest_logical); | 102 | vector, apic->dest_logical); |
103 | } | ||
99 | local_irq_restore(flags); | 104 | local_irq_restore(flags); |
100 | } | 105 | } |
101 | 106 | ||
@@ -175,7 +180,6 @@ static void init_x2apic_ldr(void) | |||
175 | int cpu = smp_processor_id(); | 180 | int cpu = smp_processor_id(); |
176 | 181 | ||
177 | per_cpu(x86_cpu_to_logical_apicid, cpu) = apic_read(APIC_LDR); | 182 | per_cpu(x86_cpu_to_logical_apicid, cpu) = apic_read(APIC_LDR); |
178 | return; | ||
179 | } | 183 | } |
180 | 184 | ||
181 | struct genapic apic_x2apic_cluster = { | 185 | struct genapic apic_x2apic_cluster = { |