Skip to contentSkip to conversation

i386 Vmi apic header

RFC PATCH In review Zachary Amsden 1 participant 1 message Mar 13, 2006

lore
Share & tools
lore
#0 lore raw

RFC PATCH 15/24 i386 Vmi apic header

Move APIC read / write accessors to sub-arch layer. Note that we don't bother to implement apic_write_atomic any different, as it is only present to work around old processor erratums (Pentium Processor Spec update 11AP), and VMI kernels do not offer support for this class of processor.

include/asm-i386/apic.h +1 -19
Index: linux-2.6.16-rc5/include/asm-i386/apic.h
===================================================================
@@ -7,6 +7,7 @@
 #include <asm/apicdef.h>
 #include <asm/processor.h>
 #include <asm/system.h>
+#include <mach_apicops.h>
 
 #define Dprintk(x...)
 
@@ -45,25 +46,6 @@ static inline void lapic_enable(void)
 
 #ifdef CONFIG_X86_LOCAL_APIC
 
-/*
- * Basic functions accessing APICs.
- */
-
-static __inline void apic_write(unsigned long reg, unsigned long v)
-{
-	*((volatile unsigned long *)(APIC_BASE+reg)) = v;
-}
-
-static __inline void apic_write_atomic(unsigned long reg, unsigned long v)
-{
-	xchg((volatile unsigned long *)(APIC_BASE+reg), v);
-}
-
-static __inline unsigned long apic_read(unsigned long reg)
-{
-	return *((volatile unsigned long *)(APIC_BASE+reg));
-}
-
 static __inline__ void apic_wait_icr_idle(void)
 {
 	while ( apic_read( APIC_ICR ) & APIC_ICR_BUSY )
include/asm-i386/mach-vmi/mach_apicops.h +63 -0

63 lines not on this page · raw message

include/asm-i386/mach-default/mach_apicops.h +29 -0
Index: linux-2.6.16-rc5/include/asm-i386/mach-default/mach_apicops.h
===================================================================
@@ -0,0 +1,29 @@
+/*
+ * Basic functions accessing APICs.
+ * These may optionally be overridden by the subarchitecture in
+ * mach_apicops.h.
+ */
+
+#ifndef __ASM_MACH_APICOPS_H
+#define __ASM_MACH_APICOPS_H
+
+
+#ifdef CONFIG_X86_LOCAL_APIC
+
+static __inline void apic_write(unsigned long reg, unsigned long v)
+{
+	*((volatile unsigned long *)(APIC_BASE+reg)) = v;
+}
+
+static __inline void apic_write_atomic(unsigned long reg, unsigned long v)
+{
+	xchg((volatile unsigned long *)(APIC_BASE+reg), v);
+}
+static __inline unsigned long apic_read(unsigned long reg)
+{
+	return *((volatile unsigned long *)(APIC_BASE+reg));
+}
+
+#endif /* CONFIG_X86_LOCAL_APIC */
+
+#endif /* __ASM_MACH_APICOPS_H */