]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
x86, apic: Use apic noop driver
authorCyrill Gorcunov <gorcunov@openvz.org>
Tue, 13 Oct 2009 20:07:04 +0000 (00:07 +0400)
committerIngo Molnar <mingo@elte.hu>
Wed, 14 Oct 2009 07:17:00 +0000 (09:17 +0200)
In case if apic were disabled we may use the whole apic NOOP driver
instead of sparse poking the some functions in apic driver.

Also NOOP would catch any inappropriate apic operation calls (not
just read/write).

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: yinghai@kernel.org
Cc: macro@linux-mips.org
LKML-Reference: <20091013201022.747817361@openvz.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/apic/apic.c

index 894aa97f07178ed4972e39381fa375781ea4f158..61a5628810daad19c5eeac403916f2b64865244b 100644 (file)
@@ -241,28 +241,12 @@ static int modern_apic(void)
 }
 
 /*
- * bare function to substitute write operation
- * and it's _that_ fast :)
- */
-static void native_apic_write_dummy(u32 reg, u32 v)
-{
-       WARN_ON_ONCE((cpu_has_apic || !disable_apic));
-}
-
-static u32 native_apic_read_dummy(u32 reg)
-{
-       WARN_ON_ONCE((cpu_has_apic && !disable_apic));
-       return 0;
-}
-
-/*
- * right after this call apic->write/read doesn't do anything
- * note that there is no restore operation it works one way
+ * right after this call apic become NOOP driven
+ * so apic->write/read doesn't do anything
  */
 void apic_disable(void)
 {
-       apic->read = native_apic_read_dummy;
-       apic->write = native_apic_write_dummy;
+       apic = &apic_noop;
 }
 
 void native_apic_wait_icr_idle(void)