diff mbox

[07/13] lib/x86/apic: Consolidate over MSR_IA32_APICBASE

Message ID b78e41f1e849dd0c2214a07ffb49832955a23c67.1388858359.git.jan.kiszka@web.de (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Kiszka Jan. 4, 2014, 5:59 p.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 lib/x86/apic.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/lib/x86/apic.c b/lib/x86/apic.c
index 7bb98ed..6876d85 100644
--- a/lib/x86/apic.c
+++ b/lib/x86/apic.c
@@ -1,5 +1,6 @@ 
 #include "libcflat.h"
 #include "apic.h"
+#include "msr.h"
 
 static void *g_apic = (void *)0xfee00000;
 static void *g_ioapic = (void *)0xfec00000;
@@ -99,8 +100,6 @@  uint32_t apic_id(void)
     return apic_ops->id();
 }
 
-#define MSR_APIC_BASE 0x0000001b
-
 int enable_x2apic(void)
 {
     unsigned a, b, c, d;
@@ -108,9 +107,9 @@  int enable_x2apic(void)
     asm ("cpuid" : "=a"(a), "=b"(b), "=c"(c), "=d"(d) : "0"(1));
 
     if (c & (1 << 21)) {
-        asm ("rdmsr" : "=a"(a), "=d"(d) : "c"(MSR_APIC_BASE));
+        asm ("rdmsr" : "=a"(a), "=d"(d) : "c"(MSR_IA32_APICBASE));
         a |= 1 << 10;
-        asm ("wrmsr" : : "a"(a), "d"(d), "c"(MSR_APIC_BASE));
+        asm ("wrmsr" : : "a"(a), "d"(d), "c"(MSR_IA32_APICBASE));
         apic_ops = &x2apic_ops;
         return 1;
     } else {