diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-01-28 00:50:47 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-28 17:20:23 -0500 |
commit | 5257c5111ca21c8e857b65a79ab986b313e1c362 (patch) | |
tree | 0d48a9c4a0e295e24647818c21896941cef0286c | |
parent | 3f57a318c36e1f24070a18df8c4971ca08d33142 (diff) |
x86, apic: clean up ->cpu_to_logical_apicid()
- separate the namespace
- remove macros
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/include/asm/bigsmp/apic.h | 6 | ||||
-rw-r--r-- | arch/x86/include/asm/es7000/apic.h | 16 | ||||
-rw-r--r-- | arch/x86/include/asm/mach-default/mach_apic.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/mach-generic/mach_apic.h | 1 | ||||
-rw-r--r-- | arch/x86/include/asm/numaq/apic.h | 3 | ||||
-rw-r--r-- | arch/x86/include/asm/summit/apic.h | 8 | ||||
-rw-r--r-- | arch/x86/kernel/ipi.c | 4 | ||||
-rw-r--r-- | arch/x86/mach-generic/bigsmp.c | 2 | ||||
-rw-r--r-- | arch/x86/mach-generic/default.c | 2 | ||||
-rw-r--r-- | arch/x86/mach-generic/es7000.c | 2 | ||||
-rw-r--r-- | arch/x86/mach-generic/numaq.c | 2 | ||||
-rw-r--r-- | arch/x86/mach-generic/summit.c | 2 |
12 files changed, 25 insertions, 25 deletions
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h index 77f0b7348755..d0d894ff7d3e 100644 --- a/arch/x86/include/asm/bigsmp/apic.h +++ b/arch/x86/include/asm/bigsmp/apic.h | |||
@@ -82,7 +82,7 @@ static inline physid_mask_t apicid_to_cpu_present(int phys_apicid) | |||
82 | 82 | ||
83 | extern u8 cpu_2_logical_apicid[]; | 83 | extern u8 cpu_2_logical_apicid[]; |
84 | /* Mapping from cpu number to logical apicid */ | 84 | /* Mapping from cpu number to logical apicid */ |
85 | static inline int cpu_to_logical_apicid(int cpu) | 85 | static inline int bigsmp_cpu_to_logical_apicid(int cpu) |
86 | { | 86 | { |
87 | if (cpu >= nr_cpu_ids) | 87 | if (cpu >= nr_cpu_ids) |
88 | return BAD_APICID; | 88 | return BAD_APICID; |
@@ -115,7 +115,7 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask) | |||
115 | int apicid; | 115 | int apicid; |
116 | 116 | ||
117 | cpu = first_cpu(*cpumask); | 117 | cpu = first_cpu(*cpumask); |
118 | apicid = cpu_to_logical_apicid(cpu); | 118 | apicid = bigsmp_cpu_to_logical_apicid(cpu); |
119 | return apicid; | 119 | return apicid; |
120 | } | 120 | } |
121 | 121 | ||
@@ -132,7 +132,7 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask, | |||
132 | if (cpumask_test_cpu(cpu, cpu_online_mask)) | 132 | if (cpumask_test_cpu(cpu, cpu_online_mask)) |
133 | break; | 133 | break; |
134 | if (cpu < nr_cpu_ids) | 134 | if (cpu < nr_cpu_ids) |
135 | return cpu_to_logical_apicid(cpu); | 135 | return bigsmp_cpu_to_logical_apicid(cpu); |
136 | 136 | ||
137 | return BAD_APICID; | 137 | return BAD_APICID; |
138 | } | 138 | } |
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h index bcdf31400dfa..e0cd07e74f98 100644 --- a/arch/x86/include/asm/es7000/apic.h +++ b/arch/x86/include/asm/es7000/apic.h | |||
@@ -109,7 +109,7 @@ static inline physid_mask_t apicid_to_cpu_present(int phys_apicid) | |||
109 | 109 | ||
110 | extern u8 cpu_2_logical_apicid[]; | 110 | extern u8 cpu_2_logical_apicid[]; |
111 | /* Mapping from cpu number to logical apicid */ | 111 | /* Mapping from cpu number to logical apicid */ |
112 | static inline int cpu_to_logical_apicid(int cpu) | 112 | static inline int es7000_cpu_to_logical_apicid(int cpu) |
113 | { | 113 | { |
114 | #ifdef CONFIG_SMP | 114 | #ifdef CONFIG_SMP |
115 | if (cpu >= nr_cpu_ids) | 115 | if (cpu >= nr_cpu_ids) |
@@ -155,10 +155,10 @@ cpu_mask_to_apicid_cluster(const struct cpumask *cpumask) | |||
155 | * on the same apicid cluster return default value of target_cpus(): | 155 | * on the same apicid cluster return default value of target_cpus(): |
156 | */ | 156 | */ |
157 | cpu = cpumask_first(cpumask); | 157 | cpu = cpumask_first(cpumask); |
158 | apicid = cpu_to_logical_apicid(cpu); | 158 | apicid = es7000_cpu_to_logical_apicid(cpu); |
159 | while (cpus_found < num_bits_set) { | 159 | while (cpus_found < num_bits_set) { |
160 | if (cpumask_test_cpu(cpu, cpumask)) { | 160 | if (cpumask_test_cpu(cpu, cpumask)) { |
161 | int new_apicid = cpu_to_logical_apicid(cpu); | 161 | int new_apicid = es7000_cpu_to_logical_apicid(cpu); |
162 | if (apicid_cluster(apicid) != | 162 | if (apicid_cluster(apicid) != |
163 | apicid_cluster(new_apicid)){ | 163 | apicid_cluster(new_apicid)){ |
164 | printk ("%s: Not a valid mask!\n", __func__); | 164 | printk ("%s: Not a valid mask!\n", __func__); |
@@ -182,20 +182,20 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask) | |||
182 | num_bits_set = cpus_weight(*cpumask); | 182 | num_bits_set = cpus_weight(*cpumask); |
183 | /* Return id to all */ | 183 | /* Return id to all */ |
184 | if (num_bits_set == nr_cpu_ids) | 184 | if (num_bits_set == nr_cpu_ids) |
185 | return cpu_to_logical_apicid(0); | 185 | return es7000_cpu_to_logical_apicid(0); |
186 | /* | 186 | /* |
187 | * The cpus in the mask must all be on the apic cluster. If are not | 187 | * The cpus in the mask must all be on the apic cluster. If are not |
188 | * on the same apicid cluster return default value of target_cpus(): | 188 | * on the same apicid cluster return default value of target_cpus(): |
189 | */ | 189 | */ |
190 | cpu = first_cpu(*cpumask); | 190 | cpu = first_cpu(*cpumask); |
191 | apicid = cpu_to_logical_apicid(cpu); | 191 | apicid = es7000_cpu_to_logical_apicid(cpu); |
192 | while (cpus_found < num_bits_set) { | 192 | while (cpus_found < num_bits_set) { |
193 | if (cpu_isset(cpu, *cpumask)) { | 193 | if (cpu_isset(cpu, *cpumask)) { |
194 | int new_apicid = cpu_to_logical_apicid(cpu); | 194 | int new_apicid = es7000_cpu_to_logical_apicid(cpu); |
195 | if (apicid_cluster(apicid) != | 195 | if (apicid_cluster(apicid) != |
196 | apicid_cluster(new_apicid)){ | 196 | apicid_cluster(new_apicid)){ |
197 | printk ("%s: Not a valid mask!\n", __func__); | 197 | printk ("%s: Not a valid mask!\n", __func__); |
198 | return cpu_to_logical_apicid(0); | 198 | return es7000_cpu_to_logical_apicid(0); |
199 | } | 199 | } |
200 | apicid = new_apicid; | 200 | apicid = new_apicid; |
201 | cpus_found++; | 201 | cpus_found++; |
@@ -209,7 +209,7 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask) | |||
209 | static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask, | 209 | static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask, |
210 | const struct cpumask *andmask) | 210 | const struct cpumask *andmask) |
211 | { | 211 | { |
212 | int apicid = cpu_to_logical_apicid(0); | 212 | int apicid = es7000_cpu_to_logical_apicid(0); |
213 | cpumask_var_t cpumask; | 213 | cpumask_var_t cpumask; |
214 | 214 | ||
215 | if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC)) | 215 | if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC)) |
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h index 2f78209d972c..eae3e4b6ed04 100644 --- a/arch/x86/include/asm/mach-default/mach_apic.h +++ b/arch/x86/include/asm/mach-default/mach_apic.h | |||
@@ -105,7 +105,7 @@ static inline physid_mask_t default_ioapic_phys_id_map(physid_mask_t phys_map) | |||
105 | } | 105 | } |
106 | 106 | ||
107 | /* Mapping from cpu number to logical apicid */ | 107 | /* Mapping from cpu number to logical apicid */ |
108 | static inline int cpu_to_logical_apicid(int cpu) | 108 | static inline int default_cpu_to_logical_apicid(int cpu) |
109 | { | 109 | { |
110 | return 1 << cpu; | 110 | return 1 << cpu; |
111 | } | 111 | } |
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h index b585a8e5f816..2ea913e8e0d0 100644 --- a/arch/x86/include/asm/mach-generic/mach_apic.h +++ b/arch/x86/include/asm/mach-generic/mach_apic.h | |||
@@ -3,7 +3,6 @@ | |||
3 | 3 | ||
4 | #include <asm/genapic.h> | 4 | #include <asm/genapic.h> |
5 | 5 | ||
6 | #define cpu_to_logical_apicid (apic->cpu_to_logical_apicid) | ||
7 | #define cpu_present_to_apicid (apic->cpu_present_to_apicid) | 6 | #define cpu_present_to_apicid (apic->cpu_present_to_apicid) |
8 | #define apicid_to_cpu_present (apic->apicid_to_cpu_present) | 7 | #define apicid_to_cpu_present (apic->apicid_to_cpu_present) |
9 | #define setup_portio_remap (apic->setup_portio_remap) | 8 | #define setup_portio_remap (apic->setup_portio_remap) |
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h index a0e3b437118c..6989abd34853 100644 --- a/arch/x86/include/asm/numaq/apic.h +++ b/arch/x86/include/asm/numaq/apic.h | |||
@@ -56,7 +56,8 @@ static inline physid_mask_t numaq_ioapic_phys_id_map(physid_mask_t phys_map) | |||
56 | 56 | ||
57 | /* Mapping from cpu number to logical apicid */ | 57 | /* Mapping from cpu number to logical apicid */ |
58 | extern u8 cpu_2_logical_apicid[]; | 58 | extern u8 cpu_2_logical_apicid[]; |
59 | static inline int cpu_to_logical_apicid(int cpu) | 59 | |
60 | static inline int numaq_cpu_to_logical_apicid(int cpu) | ||
60 | { | 61 | { |
61 | if (cpu >= nr_cpu_ids) | 62 | if (cpu >= nr_cpu_ids) |
62 | return BAD_APICID; | 63 | return BAD_APICID; |
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h index cfff2760e60d..d564d7ee3f6c 100644 --- a/arch/x86/include/asm/summit/apic.h +++ b/arch/x86/include/asm/summit/apic.h | |||
@@ -85,7 +85,7 @@ static inline int summit_apicid_to_node(int logical_apicid) | |||
85 | } | 85 | } |
86 | 86 | ||
87 | /* Mapping from cpu number to logical apicid */ | 87 | /* Mapping from cpu number to logical apicid */ |
88 | static inline int cpu_to_logical_apicid(int cpu) | 88 | static inline int summit_cpu_to_logical_apicid(int cpu) |
89 | { | 89 | { |
90 | #ifdef CONFIG_SMP | 90 | #ifdef CONFIG_SMP |
91 | if (cpu >= nr_cpu_ids) | 91 | if (cpu >= nr_cpu_ids) |
@@ -145,10 +145,10 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask) | |||
145 | * on the same apicid cluster return default value of target_cpus(): | 145 | * on the same apicid cluster return default value of target_cpus(): |
146 | */ | 146 | */ |
147 | cpu = first_cpu(*cpumask); | 147 | cpu = first_cpu(*cpumask); |
148 | apicid = cpu_to_logical_apicid(cpu); | 148 | apicid = summit_cpu_to_logical_apicid(cpu); |
149 | while (cpus_found < num_bits_set) { | 149 | while (cpus_found < num_bits_set) { |
150 | if (cpu_isset(cpu, *cpumask)) { | 150 | if (cpu_isset(cpu, *cpumask)) { |
151 | int new_apicid = cpu_to_logical_apicid(cpu); | 151 | int new_apicid = summit_cpu_to_logical_apicid(cpu); |
152 | if (apicid_cluster(apicid) != | 152 | if (apicid_cluster(apicid) != |
153 | apicid_cluster(new_apicid)){ | 153 | apicid_cluster(new_apicid)){ |
154 | printk ("%s: Not a valid mask!\n", __func__); | 154 | printk ("%s: Not a valid mask!\n", __func__); |
@@ -165,7 +165,7 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask) | |||
165 | static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask, | 165 | static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask, |
166 | const struct cpumask *andmask) | 166 | const struct cpumask *andmask) |
167 | { | 167 | { |
168 | int apicid = cpu_to_logical_apicid(0); | 168 | int apicid = summit_cpu_to_logical_apicid(0); |
169 | cpumask_var_t cpumask; | 169 | cpumask_var_t cpumask; |
170 | 170 | ||
171 | if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC)) | 171 | if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC)) |
diff --git a/arch/x86/kernel/ipi.c b/arch/x86/kernel/ipi.c index e2e4895ca69f..367c5e684fa1 100644 --- a/arch/x86/kernel/ipi.c +++ b/arch/x86/kernel/ipi.c | |||
@@ -140,7 +140,7 @@ void send_IPI_mask_sequence(const struct cpumask *mask, int vector) | |||
140 | 140 | ||
141 | local_irq_save(flags); | 141 | local_irq_save(flags); |
142 | for_each_cpu(query_cpu, mask) | 142 | for_each_cpu(query_cpu, mask) |
143 | __send_IPI_dest_field(cpu_to_logical_apicid(query_cpu), vector); | 143 | __send_IPI_dest_field(apic->cpu_to_logical_apicid(query_cpu), vector); |
144 | local_irq_restore(flags); | 144 | local_irq_restore(flags); |
145 | } | 145 | } |
146 | 146 | ||
@@ -155,7 +155,7 @@ void send_IPI_mask_allbutself(const struct cpumask *mask, int vector) | |||
155 | local_irq_save(flags); | 155 | local_irq_save(flags); |
156 | for_each_cpu(query_cpu, mask) | 156 | for_each_cpu(query_cpu, mask) |
157 | if (query_cpu != this_cpu) | 157 | if (query_cpu != this_cpu) |
158 | __send_IPI_dest_field(cpu_to_logical_apicid(query_cpu), | 158 | __send_IPI_dest_field(apic->cpu_to_logical_apicid(query_cpu), |
159 | vector); | 159 | vector); |
160 | local_irq_restore(flags); | 160 | local_irq_restore(flags); |
161 | } | 161 | } |
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c index 2f4121499e5f..cd6f02ba88ea 100644 --- a/arch/x86/mach-generic/bigsmp.c +++ b/arch/x86/mach-generic/bigsmp.c | |||
@@ -81,7 +81,7 @@ struct genapic apic_bigsmp = { | |||
81 | .setup_apic_routing = bigsmp_setup_apic_routing, | 81 | .setup_apic_routing = bigsmp_setup_apic_routing, |
82 | .multi_timer_check = NULL, | 82 | .multi_timer_check = NULL, |
83 | .apicid_to_node = bigsmp_apicid_to_node, | 83 | .apicid_to_node = bigsmp_apicid_to_node, |
84 | .cpu_to_logical_apicid = cpu_to_logical_apicid, | 84 | .cpu_to_logical_apicid = bigsmp_cpu_to_logical_apicid, |
85 | .cpu_present_to_apicid = cpu_present_to_apicid, | 85 | .cpu_present_to_apicid = cpu_present_to_apicid, |
86 | .apicid_to_cpu_present = apicid_to_cpu_present, | 86 | .apicid_to_cpu_present = apicid_to_cpu_present, |
87 | .setup_portio_remap = setup_portio_remap, | 87 | .setup_portio_remap = setup_portio_remap, |
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c index d391c2dc819d..ef9b936c41ab 100644 --- a/arch/x86/mach-generic/default.c +++ b/arch/x86/mach-generic/default.c | |||
@@ -62,7 +62,7 @@ struct genapic apic_default = { | |||
62 | .setup_apic_routing = default_setup_apic_routing, | 62 | .setup_apic_routing = default_setup_apic_routing, |
63 | .multi_timer_check = NULL, | 63 | .multi_timer_check = NULL, |
64 | .apicid_to_node = default_apicid_to_node, | 64 | .apicid_to_node = default_apicid_to_node, |
65 | .cpu_to_logical_apicid = cpu_to_logical_apicid, | 65 | .cpu_to_logical_apicid = default_cpu_to_logical_apicid, |
66 | .cpu_present_to_apicid = cpu_present_to_apicid, | 66 | .cpu_present_to_apicid = cpu_present_to_apicid, |
67 | .apicid_to_cpu_present = apicid_to_cpu_present, | 67 | .apicid_to_cpu_present = apicid_to_cpu_present, |
68 | .setup_portio_remap = setup_portio_remap, | 68 | .setup_portio_remap = setup_portio_remap, |
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c index 933f2a385990..74bf2b6b7519 100644 --- a/arch/x86/mach-generic/es7000.c +++ b/arch/x86/mach-generic/es7000.c | |||
@@ -123,7 +123,7 @@ struct genapic apic_es7000 = { | |||
123 | .setup_apic_routing = es7000_setup_apic_routing, | 123 | .setup_apic_routing = es7000_setup_apic_routing, |
124 | .multi_timer_check = NULL, | 124 | .multi_timer_check = NULL, |
125 | .apicid_to_node = es7000_apicid_to_node, | 125 | .apicid_to_node = es7000_apicid_to_node, |
126 | .cpu_to_logical_apicid = cpu_to_logical_apicid, | 126 | .cpu_to_logical_apicid = es7000_cpu_to_logical_apicid, |
127 | .cpu_present_to_apicid = cpu_present_to_apicid, | 127 | .cpu_present_to_apicid = cpu_present_to_apicid, |
128 | .apicid_to_cpu_present = apicid_to_cpu_present, | 128 | .apicid_to_cpu_present = apicid_to_cpu_present, |
129 | .setup_portio_remap = setup_portio_remap, | 129 | .setup_portio_remap = setup_portio_remap, |
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c index 38344fb99793..461f5beedb28 100644 --- a/arch/x86/mach-generic/numaq.c +++ b/arch/x86/mach-generic/numaq.c | |||
@@ -68,7 +68,7 @@ struct genapic apic_numaq = { | |||
68 | .setup_apic_routing = numaq_setup_apic_routing, | 68 | .setup_apic_routing = numaq_setup_apic_routing, |
69 | .multi_timer_check = numaq_multi_timer_check, | 69 | .multi_timer_check = numaq_multi_timer_check, |
70 | .apicid_to_node = numaq_apicid_to_node, | 70 | .apicid_to_node = numaq_apicid_to_node, |
71 | .cpu_to_logical_apicid = cpu_to_logical_apicid, | 71 | .cpu_to_logical_apicid = numaq_cpu_to_logical_apicid, |
72 | .cpu_present_to_apicid = cpu_present_to_apicid, | 72 | .cpu_present_to_apicid = cpu_present_to_apicid, |
73 | .apicid_to_cpu_present = apicid_to_cpu_present, | 73 | .apicid_to_cpu_present = apicid_to_cpu_present, |
74 | .setup_portio_remap = setup_portio_remap, | 74 | .setup_portio_remap = setup_portio_remap, |
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c index 6150604deaa3..d99be2d4efc7 100644 --- a/arch/x86/mach-generic/summit.c +++ b/arch/x86/mach-generic/summit.c | |||
@@ -61,7 +61,7 @@ struct genapic apic_summit = { | |||
61 | .setup_apic_routing = summit_setup_apic_routing, | 61 | .setup_apic_routing = summit_setup_apic_routing, |
62 | .multi_timer_check = NULL, | 62 | .multi_timer_check = NULL, |
63 | .apicid_to_node = summit_apicid_to_node, | 63 | .apicid_to_node = summit_apicid_to_node, |
64 | .cpu_to_logical_apicid = cpu_to_logical_apicid, | 64 | .cpu_to_logical_apicid = summit_cpu_to_logical_apicid, |
65 | .cpu_present_to_apicid = cpu_present_to_apicid, | 65 | .cpu_present_to_apicid = cpu_present_to_apicid, |
66 | .apicid_to_cpu_present = apicid_to_cpu_present, | 66 | .apicid_to_cpu_present = apicid_to_cpu_present, |
67 | .setup_portio_remap = setup_portio_remap, | 67 | .setup_portio_remap = setup_portio_remap, |