diff options
author | Mike Travis <travis@sgi.com> | 2008-12-16 20:33:55 -0500 |
---|---|---|
committer | Mike Travis <travis@sgi.com> | 2008-12-16 20:40:56 -0500 |
commit | 6eeb7c5a99434596c5953a95baa17d2f085664e3 (patch) | |
tree | 30fd0b08b0a427b953beaf92927468bf86fad956 /arch/x86/include/asm | |
parent | 95d313cf1c1ecedc8bec5727b09bdacbf67dfc45 (diff) |
x86: update add-cpu_mask_to_apicid_and to use struct cpumask*
Impact: use updated APIs
Various API updates for x86:add-cpu_mask_to_apicid_and
(Note: separate because previous patch has been "backported" to 2.6.27.)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Mike Travis <travis@sgi.com>
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r-- | arch/x86/include/asm/bigsmp/apic.h | 10 | ||||
-rw-r--r-- | arch/x86/include/asm/es7000/apic.h | 19 | ||||
-rw-r--r-- | arch/x86/include/asm/genapic_32.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/genapic_64.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/mach-default/mach_apic.h | 8 | ||||
-rw-r--r-- | arch/x86/include/asm/numaq/apic.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/summit/apic.h | 18 |
7 files changed, 34 insertions, 33 deletions
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h index 99f9abacf6a2..976399debb3f 100644 --- a/arch/x86/include/asm/bigsmp/apic.h +++ b/arch/x86/include/asm/bigsmp/apic.h | |||
@@ -129,8 +129,8 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask) | |||
129 | return apicid; | 129 | return apicid; |
130 | } | 130 | } |
131 | 131 | ||
132 | static inline unsigned int cpu_mask_to_apicid_and(const cpumask_t *cpumask, | 132 | static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask, |
133 | const cpumask_t *andmask) | 133 | const struct cpumask *andmask) |
134 | { | 134 | { |
135 | int cpu; | 135 | int cpu; |
136 | 136 | ||
@@ -138,9 +138,9 @@ static inline unsigned int cpu_mask_to_apicid_and(const cpumask_t *cpumask, | |||
138 | * We're using fixed IRQ delivery, can only return one phys APIC ID. | 138 | * We're using fixed IRQ delivery, can only return one phys APIC ID. |
139 | * May as well be the first. | 139 | * May as well be the first. |
140 | */ | 140 | */ |
141 | while ((cpu = next_cpu(-1, *cpumask)) < nr_cpu_ids) | 141 | cpu = cpumask_any_and(cpumask, andmask); |
142 | if (cpu_isset(cpu, *andmask)) | 142 | if (cpu < nr_cpu_ids) |
143 | return cpu_to_logical_apicid(cpu); | 143 | return cpu_to_logical_apicid(cpu); |
144 | 144 | ||
145 | return BAD_APICID; | 145 | return BAD_APICID; |
146 | } | 146 | } |
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h index c2bed772af88..ba8423c5363f 100644 --- a/arch/x86/include/asm/es7000/apic.h +++ b/arch/x86/include/asm/es7000/apic.h | |||
@@ -214,8 +214,8 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask) | |||
214 | return apicid; | 214 | return apicid; |
215 | } | 215 | } |
216 | 216 | ||
217 | static inline unsigned int cpu_mask_to_apicid_and(const cpumask_t *cpumask, | 217 | static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask, |
218 | const cpumask_t *andmask) | 218 | const struct cpumask *andmask) |
219 | { | 219 | { |
220 | int num_bits_set; | 220 | int num_bits_set; |
221 | int num_bits_set2; | 221 | int num_bits_set2; |
@@ -223,9 +223,9 @@ static inline unsigned int cpu_mask_to_apicid_and(const cpumask_t *cpumask, | |||
223 | int cpu; | 223 | int cpu; |
224 | int apicid = 0; | 224 | int apicid = 0; |
225 | 225 | ||
226 | num_bits_set = cpus_weight(*cpumask); | 226 | num_bits_set = cpumask_weight(cpumask); |
227 | num_bits_set2 = cpus_weight(*andmask); | 227 | num_bits_set2 = cpumask_weight(andmask); |
228 | num_bits_set = min_t(int, num_bits_set, num_bits_set2); | 228 | num_bits_set = min(num_bits_set, num_bits_set2); |
229 | /* Return id to all */ | 229 | /* Return id to all */ |
230 | if (num_bits_set >= nr_cpu_ids) | 230 | if (num_bits_set >= nr_cpu_ids) |
231 | #if defined CONFIG_ES7000_CLUSTERED_APIC | 231 | #if defined CONFIG_ES7000_CLUSTERED_APIC |
@@ -237,11 +237,12 @@ static inline unsigned int cpu_mask_to_apicid_and(const cpumask_t *cpumask, | |||
237 | * The cpus in the mask must all be on the apic cluster. If are not | 237 | * The cpus in the mask must all be on the apic cluster. If are not |
238 | * on the same apicid cluster return default value of TARGET_CPUS. | 238 | * on the same apicid cluster return default value of TARGET_CPUS. |
239 | */ | 239 | */ |
240 | while ((cpu = next_cpu(-1, *cpumask)) < nr_cpu_ids) | 240 | cpu = cpumask_first_and(cpumask, andmask); |
241 | if (cpu_isset(cpu, *andmask) | 241 | apicid = cpu_to_logical_apicid(cpu); |
242 | apicid = cpu_to_logical_apicid(cpu); | 242 | |
243 | while (cpus_found < num_bits_set) { | 243 | while (cpus_found < num_bits_set) { |
244 | if (cpu_isset(cpu, *cpumask) && cpu_isset(cpu, *andmask)) { | 244 | if (cpumask_test_cpu(cpu, cpumask) && |
245 | cpumask_test_cpu(cpu, andmask)) { | ||
245 | int new_apicid = cpu_to_logical_apicid(cpu); | 246 | int new_apicid = cpu_to_logical_apicid(cpu); |
246 | if (apicid_cluster(apicid) != | 247 | if (apicid_cluster(apicid) != |
247 | apicid_cluster(new_apicid)) { | 248 | apicid_cluster(new_apicid)) { |
diff --git a/arch/x86/include/asm/genapic_32.h b/arch/x86/include/asm/genapic_32.h index 325298a82237..eed6e305291f 100644 --- a/arch/x86/include/asm/genapic_32.h +++ b/arch/x86/include/asm/genapic_32.h | |||
@@ -58,8 +58,8 @@ struct genapic { | |||
58 | unsigned (*get_apic_id)(unsigned long x); | 58 | unsigned (*get_apic_id)(unsigned long x); |
59 | unsigned long apic_id_mask; | 59 | unsigned long apic_id_mask; |
60 | unsigned int (*cpu_mask_to_apicid)(const cpumask_t *cpumask); | 60 | unsigned int (*cpu_mask_to_apicid)(const cpumask_t *cpumask); |
61 | unsigned int (*cpu_mask_to_apicid_and)(const cpumask_t *cpumask, | 61 | unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask, |
62 | const cpumask_t *andmask); | 62 | const struct cpumask *andmask); |
63 | void (*vector_allocation_domain)(int cpu, cpumask_t *retmask); | 63 | void (*vector_allocation_domain)(int cpu, cpumask_t *retmask); |
64 | 64 | ||
65 | #ifdef CONFIG_SMP | 65 | #ifdef CONFIG_SMP |
diff --git a/arch/x86/include/asm/genapic_64.h b/arch/x86/include/asm/genapic_64.h index 301c7f41125d..244b71729ecb 100644 --- a/arch/x86/include/asm/genapic_64.h +++ b/arch/x86/include/asm/genapic_64.h | |||
@@ -31,8 +31,8 @@ struct genapic { | |||
31 | void (*send_IPI_self)(int vector); | 31 | void (*send_IPI_self)(int vector); |
32 | /* */ | 32 | /* */ |
33 | unsigned int (*cpu_mask_to_apicid)(const cpumask_t *cpumask); | 33 | unsigned int (*cpu_mask_to_apicid)(const cpumask_t *cpumask); |
34 | unsigned int (*cpu_mask_to_apicid_and)(const cpumask_t *cpumask, | 34 | unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask, |
35 | const cpumask_t *andmask); | 35 | const struct cpumask *andmask); |
36 | unsigned int (*phys_pkg_id)(int index_msb); | 36 | unsigned int (*phys_pkg_id)(int index_msb); |
37 | unsigned int (*get_apic_id)(unsigned long x); | 37 | unsigned int (*get_apic_id)(unsigned long x); |
38 | unsigned long (*set_apic_id)(unsigned int id); | 38 | unsigned long (*set_apic_id)(unsigned int id); |
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h index 229b605d104e..df8e024c43c5 100644 --- a/arch/x86/include/asm/mach-default/mach_apic.h +++ b/arch/x86/include/asm/mach-default/mach_apic.h | |||
@@ -67,11 +67,11 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask) | |||
67 | return cpus_addr(*cpumask)[0]; | 67 | return cpus_addr(*cpumask)[0]; |
68 | } | 68 | } |
69 | 69 | ||
70 | static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask, | 70 | static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask, |
71 | const cpumask_t *andmask) | 71 | const struct cpumask *andmask) |
72 | { | 72 | { |
73 | unsigned long mask1 = cpus_addr(*cpumask)[0]; | 73 | unsigned long mask1 = cpumask_bits(cpumask)[0]; |
74 | unsigned long mask2 = cpus_addr(*andmask)[0]; | 74 | unsigned long mask2 = cpumask_bits(andmask)[0]; |
75 | 75 | ||
76 | return (unsigned int)(mask1 & mask2); | 76 | return (unsigned int)(mask1 & mask2); |
77 | } | 77 | } |
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h index abf668ced503..c80f00d29965 100644 --- a/arch/x86/include/asm/numaq/apic.h +++ b/arch/x86/include/asm/numaq/apic.h | |||
@@ -127,8 +127,8 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask) | |||
127 | return (int) 0xF; | 127 | return (int) 0xF; |
128 | } | 128 | } |
129 | 129 | ||
130 | static inline unsigned int cpu_mask_to_apicid_and(const cpumask_t *cpumask, | 130 | static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask, |
131 | const cpumask_t *andmask) | 131 | const struct cpumask *andmask) |
132 | { | 132 | { |
133 | return (int) 0xF; | 133 | return (int) 0xF; |
134 | } | 134 | } |
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h index cbcc2c7eb1d5..651a93849341 100644 --- a/arch/x86/include/asm/summit/apic.h +++ b/arch/x86/include/asm/summit/apic.h | |||
@@ -170,8 +170,8 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask) | |||
170 | return apicid; | 170 | return apicid; |
171 | } | 171 | } |
172 | 172 | ||
173 | static inline unsigned int cpu_mask_to_apicid_and(const cpumask_t *cpumask, | 173 | static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask, |
174 | const cpumask_t *andmask) | 174 | const struct cpumask *andmask) |
175 | { | 175 | { |
176 | int num_bits_set; | 176 | int num_bits_set; |
177 | int num_bits_set2; | 177 | int num_bits_set2; |
@@ -179,9 +179,9 @@ static inline unsigned int cpu_mask_to_apicid_and(const cpumask_t *cpumask, | |||
179 | int cpu; | 179 | int cpu; |
180 | int apicid = 0; | 180 | int apicid = 0; |
181 | 181 | ||
182 | num_bits_set = cpus_weight(*cpumask); | 182 | num_bits_set = cpumask_weight(cpumask); |
183 | num_bits_set2 = cpus_weight(*andmask); | 183 | num_bits_set2 = cpumask_weight(andmask); |
184 | num_bits_set = min_t(int, num_bits_set, num_bits_set2); | 184 | num_bits_set = min(num_bits_set, num_bits_set2); |
185 | /* Return id to all */ | 185 | /* Return id to all */ |
186 | if (num_bits_set >= nr_cpu_ids) | 186 | if (num_bits_set >= nr_cpu_ids) |
187 | return 0xFF; | 187 | return 0xFF; |
@@ -189,11 +189,11 @@ static inline unsigned int cpu_mask_to_apicid_and(const cpumask_t *cpumask, | |||
189 | * The cpus in the mask must all be on the apic cluster. If are not | 189 | * The cpus in the mask must all be on the apic cluster. If are not |
190 | * on the same apicid cluster return default value of TARGET_CPUS. | 190 | * on the same apicid cluster return default value of TARGET_CPUS. |
191 | */ | 191 | */ |
192 | while ((cpu = next_cpu(-1, *cpumask)) < nr_cpu_ids) | 192 | cpu = cpumask_first_and(cpumask, andmask); |
193 | if (cpu_isset(cpu, *andmask) | 193 | apicid = cpu_to_logical_apicid(cpu); |
194 | apicid = cpu_to_logical_apicid(cpu); | ||
195 | while (cpus_found < num_bits_set) { | 194 | while (cpus_found < num_bits_set) { |
196 | if (cpu_isset(cpu, *cpumask) && cpu_isset(cpu, *andmask)) { | 195 | if (cpumask_test_cpu(cpu, cpumask) |
196 | && cpumask_test_cpu(cpu, andmask)) { | ||
197 | int new_apicid = cpu_to_logical_apicid(cpu); | 197 | int new_apicid = cpu_to_logical_apicid(cpu); |
198 | if (apicid_cluster(apicid) != | 198 | if (apicid_cluster(apicid) != |
199 | apicid_cluster(new_apicid)) { | 199 | apicid_cluster(new_apicid)) { |