aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/apic.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86/apic.h')
-rw-r--r--include/asm-x86/apic.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/asm-x86/apic.h b/include/asm-x86/apic.h
index 2d970f6bc2a1..ef1d72dbdfe0 100644
--- a/include/asm-x86/apic.h
+++ b/include/asm-x86/apic.h
@@ -98,6 +98,20 @@ extern void check_x2apic(void);
98extern void enable_x2apic(void); 98extern void enable_x2apic(void);
99extern void enable_IR_x2apic(void); 99extern void enable_IR_x2apic(void);
100extern void x2apic_icr_write(u32 low, u32 id); 100extern void x2apic_icr_write(u32 low, u32 id);
101static inline int x2apic_enabled(void)
102{
103 int msr, msr2;
104
105 if (!cpu_has_x2apic)
106 return 0;
107
108 rdmsr(MSR_IA32_APICBASE, msr, msr2);
109 if (msr & X2APIC_ENABLE)
110 return 1;
111 return 0;
112}
113#else
114#define x2apic_enabled() 0
101#endif 115#endif
102 116
103struct apic_ops { 117struct apic_ops {