[PATCH] paravirt: Add APIC accessors to paravirt-ops.
Add APIC accessors to paravirt-ops. Unfortunately, we need two write functions, as some older broken hardware requires workarounds for Pentium APIC errata - this is the purpose of apic_write_atomic. AK: replaced __inline with inline Signed-off-by: Zachary Amsden <zach@vmware.com> Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Andi Kleen <ak@suse.de> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Signed-off-by: Andrew Morton <akpm@osdl.org>
This commit is contained in:
committed by
Andi Kleen
parent
6020c8f315
commit
13623d7930
@@ -37,18 +37,27 @@ extern void generic_apic_probe(void);
|
||||
/*
|
||||
* Basic functions accessing APICs.
|
||||
*/
|
||||
#ifdef CONFIG_PARAVIRT
|
||||
#include <asm/paravirt.h>
|
||||
#else
|
||||
#define apic_write native_apic_write
|
||||
#define apic_write_atomic native_apic_write_atomic
|
||||
#define apic_read native_apic_read
|
||||
#endif
|
||||
|
||||
static __inline void apic_write(unsigned long reg, unsigned long v)
|
||||
static __inline fastcall void native_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)
|
||||
static __inline fastcall void native_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)
|
||||
static __inline fastcall unsigned long native_apic_read(unsigned long reg)
|
||||
{
|
||||
return *((volatile unsigned long *)(APIC_BASE+reg));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user