i386 Vmi apic header
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.
Signed-off-by Zachary Amsden <[email protected]>
Signed-off-by Daniel Arai <[email protected]>
include/asm-i386/apic.h +1 -19
@@ -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 __inlinevoid apic_write (unsigned long reg,unsigned long v) -{ - *((volatile unsigned long *)(APIC_BASE +reg)) = v; -} - -static __inlinevoid apic_write_atomic (unsigned long reg,unsigned long v) -{ -xchg ((volatile unsigned long *)(APIC_BASE +reg), v); -} - -static __inlineunsigned 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
@@ -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 __inlinevoid apic_write (unsigned long reg,unsigned long v) +{ + *((volatile unsigned long *)(APIC_BASE +reg)) = v; +} + +static __inlinevoid apic_write_atomic (unsigned long reg,unsigned long v) +{ +xchg ((volatile unsigned long *)(APIC_BASE +reg), v); +} +static __inlineunsigned long apic_read (unsigned long reg) +{ +return *((volatile unsigned long *)(APIC_BASE +reg)); +} + +#endif /* CONFIG_X86_LOCAL_APIC */ + +#endif /* __ASM_MACH_APICOPS_H */