[6/8] x86: apic - unify verify_local_APIC
diff mbox series

Message ID 20080814184652.179229281@gmail.com
State New, archived
Headers show
Series
  • another one step toward APIC merging
Related show

Commit Message

Cyrill Gorcunov Jan. 1, 1970, midnight UTC
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---

Patch
diff mbox series

Index: linux-2.6.git/arch/x86/kernel/apic_32.c
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/apic_32.c	2008-08-14 22:18:00.000000000 +0400
+++ linux-2.6.git/arch/x86/kernel/apic_32.c	2008-08-14 22:21:49.000000000 +0400
@@ -882,6 +882,12 @@  int __init verify_local_APIC(void)
 	 */
 	reg0 = apic_read(APIC_ID);
 	apic_printk(APIC_DEBUG, "Getting ID: %x\n", reg0);
+	apic_write(APIC_ID, reg0 ^ APIC_ID_MASK);
+	reg1 = apic_read(APIC_ID);
+	apic_printk(APIC_DEBUG, "Getting ID: %x\n", reg1);
+	apic_write(APIC_ID, reg0);
+	if (reg1 != (reg0 ^ APIC_ID_MASK))
+		return 0;
 
 	/*
 	 * The next two are just to see if we have sane values.