diff options
-rw-r--r-- | arch/x86/include/asm/apic.h | 20 | ||||
-rw-r--r-- | arch/x86/kernel/apic/apic_flat_64.c | 18 |
2 files changed, 12 insertions, 26 deletions
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index 00f5962d82d0..130a9e2b4586 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h | |||
@@ -489,10 +489,19 @@ static inline int default_apic_id_registered(void) | |||
489 | return physid_isset(read_apic_id(), phys_cpu_present_map); | 489 | return physid_isset(read_apic_id(), phys_cpu_present_map); |
490 | } | 490 | } |
491 | 491 | ||
492 | static inline int default_phys_pkg_id(int cpuid_apic, int index_msb) | ||
493 | { | ||
494 | return cpuid_apic >> index_msb; | ||
495 | } | ||
496 | |||
497 | extern int default_apicid_to_node(int logical_apicid); | ||
498 | |||
499 | #endif | ||
500 | |||
492 | static inline unsigned int | 501 | static inline unsigned int |
493 | default_cpu_mask_to_apicid(const struct cpumask *cpumask) | 502 | default_cpu_mask_to_apicid(const struct cpumask *cpumask) |
494 | { | 503 | { |
495 | return cpumask_bits(cpumask)[0]; | 504 | return cpumask_bits(cpumask)[0] & APIC_ALL_CPUS; |
496 | } | 505 | } |
497 | 506 | ||
498 | static inline unsigned int | 507 | static inline unsigned int |
@@ -506,15 +515,6 @@ default_cpu_mask_to_apicid_and(const struct cpumask *cpumask, | |||
506 | return (unsigned int)(mask1 & mask2 & mask3); | 515 | return (unsigned int)(mask1 & mask2 & mask3); |
507 | } | 516 | } |
508 | 517 | ||
509 | static inline int default_phys_pkg_id(int cpuid_apic, int index_msb) | ||
510 | { | ||
511 | return cpuid_apic >> index_msb; | ||
512 | } | ||
513 | |||
514 | extern int default_apicid_to_node(int logical_apicid); | ||
515 | |||
516 | #endif | ||
517 | |||
518 | static inline unsigned long default_check_apicid_used(physid_mask_t bitmap, int apicid) | 518 | static inline unsigned long default_check_apicid_used(physid_mask_t bitmap, int apicid) |
519 | { | 519 | { |
520 | return physid_isset(apicid, bitmap); | 520 | return physid_isset(apicid, bitmap); |
diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c index f933822dba18..0014714ea97b 100644 --- a/arch/x86/kernel/apic/apic_flat_64.c +++ b/arch/x86/kernel/apic/apic_flat_64.c | |||
@@ -159,20 +159,6 @@ static int flat_apic_id_registered(void) | |||
159 | return physid_isset(read_xapic_id(), phys_cpu_present_map); | 159 | return physid_isset(read_xapic_id(), phys_cpu_present_map); |
160 | } | 160 | } |
161 | 161 | ||
162 | static unsigned int flat_cpu_mask_to_apicid(const struct cpumask *cpumask) | ||
163 | { | ||
164 | return cpumask_bits(cpumask)[0] & APIC_ALL_CPUS; | ||
165 | } | ||
166 | |||
167 | static unsigned int flat_cpu_mask_to_apicid_and(const struct cpumask *cpumask, | ||
168 | const struct cpumask *andmask) | ||
169 | { | ||
170 | unsigned long mask1 = cpumask_bits(cpumask)[0] & APIC_ALL_CPUS; | ||
171 | unsigned long mask2 = cpumask_bits(andmask)[0] & APIC_ALL_CPUS; | ||
172 | |||
173 | return mask1 & mask2; | ||
174 | } | ||
175 | |||
176 | static int flat_phys_pkg_id(int initial_apic_id, int index_msb) | 162 | static int flat_phys_pkg_id(int initial_apic_id, int index_msb) |
177 | { | 163 | { |
178 | return hard_smp_processor_id() >> index_msb; | 164 | return hard_smp_processor_id() >> index_msb; |
@@ -213,8 +199,8 @@ struct apic apic_flat = { | |||
213 | .set_apic_id = set_apic_id, | 199 | .set_apic_id = set_apic_id, |
214 | .apic_id_mask = 0xFFu << 24, | 200 | .apic_id_mask = 0xFFu << 24, |
215 | 201 | ||
216 | .cpu_mask_to_apicid = flat_cpu_mask_to_apicid, | 202 | .cpu_mask_to_apicid = default_cpu_mask_to_apicid, |
217 | .cpu_mask_to_apicid_and = flat_cpu_mask_to_apicid_and, | 203 | .cpu_mask_to_apicid_and = default_cpu_mask_to_apicid_and, |
218 | 204 | ||
219 | .send_IPI_mask = flat_send_IPI_mask, | 205 | .send_IPI_mask = flat_send_IPI_mask, |
220 | .send_IPI_mask_allbutself = flat_send_IPI_mask_allbutself, | 206 | .send_IPI_mask_allbutself = flat_send_IPI_mask_allbutself, |