diff options
Diffstat (limited to 'arch/x86/include/asm/apic.h')
-rw-r--r-- | arch/x86/include/asm/apic.h | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index 394d177d721b..df8a300dfe6c 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h | |||
@@ -75,7 +75,7 @@ static inline void default_inquire_remote_apic(int apicid) | |||
75 | #define setup_secondary_clock setup_secondary_APIC_clock | 75 | #define setup_secondary_clock setup_secondary_APIC_clock |
76 | #endif | 76 | #endif |
77 | 77 | ||
78 | #ifdef CONFIG_X86_VSMP | 78 | #ifdef CONFIG_X86_64 |
79 | extern int is_vsmp_box(void); | 79 | extern int is_vsmp_box(void); |
80 | #else | 80 | #else |
81 | static inline int is_vsmp_box(void) | 81 | static inline int is_vsmp_box(void) |
@@ -108,6 +108,16 @@ extern void native_apic_icr_write(u32 low, u32 id); | |||
108 | extern u64 native_apic_icr_read(void); | 108 | extern u64 native_apic_icr_read(void); |
109 | 109 | ||
110 | #ifdef CONFIG_X86_X2APIC | 110 | #ifdef CONFIG_X86_X2APIC |
111 | /* | ||
112 | * Make previous memory operations globally visible before | ||
113 | * sending the IPI through x2apic wrmsr. We need a serializing instruction or | ||
114 | * mfence for this. | ||
115 | */ | ||
116 | static inline void x2apic_wrmsr_fence(void) | ||
117 | { | ||
118 | asm volatile("mfence" : : : "memory"); | ||
119 | } | ||
120 | |||
111 | static inline void native_apic_msr_write(u32 reg, u32 v) | 121 | static inline void native_apic_msr_write(u32 reg, u32 v) |
112 | { | 122 | { |
113 | if (reg == APIC_DFR || reg == APIC_ID || reg == APIC_LDR || | 123 | if (reg == APIC_DFR || reg == APIC_ID || reg == APIC_LDR || |
@@ -184,6 +194,9 @@ static inline int x2apic_enabled(void) | |||
184 | { | 194 | { |
185 | return 0; | 195 | return 0; |
186 | } | 196 | } |
197 | |||
198 | #define x2apic 0 | ||
199 | |||
187 | #endif | 200 | #endif |
188 | 201 | ||
189 | extern int get_physical_broadcast(void); | 202 | extern int get_physical_broadcast(void); |
@@ -476,10 +489,19 @@ static inline int default_apic_id_registered(void) | |||
476 | return physid_isset(read_apic_id(), phys_cpu_present_map); | 489 | return physid_isset(read_apic_id(), phys_cpu_present_map); |
477 | } | 490 | } |
478 | 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 | |||
479 | static inline unsigned int | 501 | static inline unsigned int |
480 | default_cpu_mask_to_apicid(const struct cpumask *cpumask) | 502 | default_cpu_mask_to_apicid(const struct cpumask *cpumask) |
481 | { | 503 | { |
482 | return cpumask_bits(cpumask)[0]; | 504 | return cpumask_bits(cpumask)[0] & APIC_ALL_CPUS; |
483 | } | 505 | } |
484 | 506 | ||
485 | static inline unsigned int | 507 | static inline unsigned int |
@@ -493,15 +515,6 @@ default_cpu_mask_to_apicid_and(const struct cpumask *cpumask, | |||
493 | return (unsigned int)(mask1 & mask2 & mask3); | 515 | return (unsigned int)(mask1 & mask2 & mask3); |
494 | } | 516 | } |
495 | 517 | ||
496 | static inline int default_phys_pkg_id(int cpuid_apic, int index_msb) | ||
497 | { | ||
498 | return cpuid_apic >> index_msb; | ||
499 | } | ||
500 | |||
501 | extern int default_apicid_to_node(int logical_apicid); | ||
502 | |||
503 | #endif | ||
504 | |||
505 | 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) |
506 | { | 519 | { |
507 | return physid_isset(apicid, bitmap); | 520 | return physid_isset(apicid, bitmap); |