x86, um: initial part of asm-um move
[safe/jmp/linux-2.6] / include / asm-x86 / apic.h
index 300b65e..ef1d72d 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _ASM_X86_APIC_H
-#define _ASM_X86_APIC_H
+#ifndef ASM_X86__APIC_H
+#define ASM_X86__APIC_H
 
 #include <linux/pm.h>
 #include <linux/delay.h>
@@ -14,8 +14,6 @@
 
 #define ARCH_APICTIMER_STOPS_ON_C3     1
 
-#define Dprintk printk
-
 /*
  * Debugging macros
  */
@@ -42,8 +40,6 @@ extern void generic_apic_probe(void);
 extern unsigned int apic_verbosity;
 extern int local_apic_timer_c2_ok;
 
-extern int ioapic_force;
-
 extern int disable_apic;
 /*
  * Basic functions accessing APICs.
@@ -56,6 +52,11 @@ extern int disable_apic;
 #endif
 
 extern int is_vsmp_box(void);
+extern void xapic_wait_icr_idle(void);
+extern u32 safe_xapic_wait_icr_idle(void);
+extern u64 xapic_icr_read(void);
+extern void xapic_icr_write(u32, u32);
+extern int setup_profiling_timer(unsigned int);
 
 static inline void native_apic_mem_write(u32 reg, u32 v)
 {
@@ -97,6 +98,20 @@ extern void check_x2apic(void);
 extern void enable_x2apic(void);
 extern void enable_IR_x2apic(void);
 extern void x2apic_icr_write(u32 low, u32 id);
+static inline int x2apic_enabled(void)
+{
+       int msr, msr2;
+
+       if (!cpu_has_x2apic)
+               return 0;
+
+       rdmsr(MSR_IA32_APICBASE, msr, msr2);
+       if (msr & X2APIC_ENABLE)
+               return 1;
+       return 0;
+}
+#else
+#define x2apic_enabled()       0
 #endif
 
 struct apic_ops {
@@ -131,18 +146,12 @@ static inline void ack_x2APIC_irq(void)
 static inline void ack_APIC_irq(void)
 {
        /*
-        * ack_APIC_irq() actually gets compiled as a single instruction:
-        * - a single rmw on Pentium/82489DX
-        * - a single write on P6+ cores (CONFIG_X86_GOOD_APIC)
+        * ack_APIC_irq() actually gets compiled as a single instruction
         * ... yummie.
         */
 
        /* Docs say use 0 for future compatibility */
-#ifdef CONFIG_X86_32
        apic_write(APIC_EOI, 0);
-#else
-       native_apic_mem_write(APIC_EOI, 0);
-#endif
 }
 
 extern int lapic_get_maxlvt(void);
@@ -187,4 +196,4 @@ static inline void init_apic_mappings(void) { }
 
 #endif /* !CONFIG_X86_LOCAL_APIC */
 
-#endif /* __ASM_APIC_H */
+#endif /* ASM_X86__APIC_H */