aboutsummaryrefslogtreecommitdiff
path: root/include/asm-x86/apic.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-18 23:00:05 +0200
committerIngo Molnar <mingo@elte.hu>2008-07-18 23:00:05 +0200
commit453c1404c5273a30d715e5a83372a78cff70b6d9 (patch)
tree94a5a3abd85137c4def416a84a45989751260f20 /include/asm-x86/apic.h
parenta208f37a465e222218974ab20a31b42b7b4893b2 (diff)
parent35b680557f95564f70f21a8d3f5c72e101fab260 (diff)
Merge branch 'x86/apic' into x86/x2apic
Conflicts: arch/x86/kernel/paravirt.c arch/x86/kernel/smpboot.c arch/x86/kernel/vmi_32.c arch/x86/lguest/boot.c arch/x86/xen/enlighten.c include/asm-x86/apic.h include/asm-x86/paravirt.h Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86/apic.h')
-rw-r--r--include/asm-x86/apic.h29
1 files changed, 9 insertions, 20 deletions
diff --git a/include/asm-x86/apic.h b/include/asm-x86/apic.h
index fcd2f01277b..300b65e5724 100644
--- a/include/asm-x86/apic.h
+++ b/include/asm-x86/apic.h
@@ -3,6 +3,8 @@
#include <linux/pm.h>
#include <linux/delay.h>
+
+#include <asm/alternative.h>
#include <asm/fixmap.h>
#include <asm/apicdef.h>
#include <asm/processor.h>
@@ -12,7 +14,7 @@
#define ARCH_APICTIMER_STOPS_ON_C3 1
-#define Dprintk(x...)
+#define Dprintk printk
/*
* Debugging macros
@@ -37,7 +39,7 @@ extern void generic_apic_probe(void);
#ifdef CONFIG_X86_LOCAL_APIC
-extern int apic_verbosity;
+extern unsigned int apic_verbosity;
extern int local_apic_timer_c2_ok;
extern int ioapic_force;
@@ -57,12 +59,11 @@ extern int is_vsmp_box(void);
static inline void native_apic_mem_write(u32 reg, u32 v)
{
- *((volatile u32 *)(APIC_BASE + reg)) = v;
-}
+ volatile u32 *addr = (volatile u32 *)(APIC_BASE + reg);
-static inline void native_apic_mem_write_atomic(u32 reg, u32 v)
-{
- (void)xchg((u32 *)(APIC_BASE + reg), v);
+ alternative_io("movl %0, %1", "xchgl %0, %1", X86_FEATURE_11AP,
+ ASM_OUTPUT2("=r" (v), "=m" (*addr)),
+ ASM_OUTPUT2("0" (v), "m" (*addr)));
}
static inline u32 native_apic_mem_read(u32 reg)
@@ -101,7 +102,6 @@ extern void x2apic_icr_write(u32 low, u32 id);
struct apic_ops {
u32 (*read)(u32 reg);
void (*write)(u32 reg, u32 v);
- void (*write_atomic)(u32 reg, u32 v);
u64 (*icr_read)(void);
void (*icr_write)(u32 low, u32 high);
void (*wait_icr_idle)(void);
@@ -112,7 +112,6 @@ extern struct apic_ops *apic_ops;
#define apic_read (apic_ops->read)
#define apic_write (apic_ops->write)
-#define apic_write_atomic (apic_ops->write_atomic)
#define apic_icr_read (apic_ops->icr_read)
#define apic_icr_write (apic_ops->icr_write)
#define apic_wait_icr_idle (apic_ops->wait_icr_idle)
@@ -120,16 +119,6 @@ extern struct apic_ops *apic_ops;
extern int get_physical_broadcast(void);
-#ifdef CONFIG_X86_GOOD_APIC
-# define FORCE_READ_AROUND_WRITE 0
-# define apic_read_around(x)
-# define apic_write_around(x, y) apic_write((x), (y))
-#else
-# define FORCE_READ_AROUND_WRITE 1
-# define apic_read_around(x) apic_read(x)
-# define apic_write_around(x, y) apic_write_atomic((x), (y))
-#endif
-
#ifdef CONFIG_X86_64
static inline void ack_x2APIC_irq(void)
{
@@ -150,7 +139,7 @@ static inline void ack_APIC_irq(void)
/* Docs say use 0 for future compatibility */
#ifdef CONFIG_X86_32
- apic_write_around(APIC_EOI, 0);
+ apic_write(APIC_EOI, 0);
#else
native_apic_mem_write(APIC_EOI, 0);
#endif