Merge master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
[pandora-kernel.git] / arch / x86_64 / kernel / i8259.c
index b2a238b..86b2c1e 100644 (file)
        BI(x,8) BI(x,9) BI(x,a) BI(x,b) \
        BI(x,c) BI(x,d) BI(x,e) BI(x,f)
 
-#define BUILD_14_IRQS(x) \
+#define BUILD_15_IRQS(x) \
        BI(x,0) BI(x,1) BI(x,2) BI(x,3) \
        BI(x,4) BI(x,5) BI(x,6) BI(x,7) \
        BI(x,8) BI(x,9) BI(x,a) BI(x,b) \
-       BI(x,c) BI(x,d)
+       BI(x,c) BI(x,d) BI(x,e)
 
 /*
  * ISA PIC or low IO-APIC triggered (INTA-cycle or APIC) interrupts:
@@ -73,13 +73,13 @@ BUILD_16_IRQS(0x8) BUILD_16_IRQS(0x9) BUILD_16_IRQS(0xa) BUILD_16_IRQS(0xb)
 BUILD_16_IRQS(0xc) BUILD_16_IRQS(0xd)
 
 #ifdef CONFIG_PCI_MSI
-       BUILD_14_IRQS(0xe)
+       BUILD_15_IRQS(0xe)
 #endif
 
 #endif
 
 #undef BUILD_16_IRQS
-#undef BUILD_14_IRQS
+#undef BUILD_15_IRQS
 #undef BI
 
 
@@ -92,11 +92,11 @@ BUILD_16_IRQS(0xc) BUILD_16_IRQS(0xd)
        IRQ(x,8), IRQ(x,9), IRQ(x,a), IRQ(x,b), \
        IRQ(x,c), IRQ(x,d), IRQ(x,e), IRQ(x,f)
 
-#define IRQLIST_14(x) \
+#define IRQLIST_15(x) \
        IRQ(x,0), IRQ(x,1), IRQ(x,2), IRQ(x,3), \
        IRQ(x,4), IRQ(x,5), IRQ(x,6), IRQ(x,7), \
        IRQ(x,8), IRQ(x,9), IRQ(x,a), IRQ(x,b), \
-       IRQ(x,c), IRQ(x,d)
+       IRQ(x,c), IRQ(x,d), IRQ(x,e)
 
 void (*interrupt[NR_IRQS])(void) = {
        IRQLIST_16(0x0),
@@ -108,7 +108,7 @@ void (*interrupt[NR_IRQS])(void) = {
        IRQLIST_16(0xc), IRQLIST_16(0xd)
 
 #ifdef CONFIG_PCI_MSI
-       , IRQLIST_14(0xe)
+       , IRQLIST_15(0xe)
 #endif
 
 #endif
@@ -133,7 +133,7 @@ static void end_8259A_irq (unsigned int irq)
 {
        if (irq > 256) { 
                char var;
-               printk("return %p stack %p ti %p\n", __builtin_return_address(0), &var, current->thread_info); 
+               printk("return %p stack %p ti %p\n", __builtin_return_address(0), &var, task_thread_info(current));
 
                BUG(); 
        }
@@ -278,7 +278,7 @@ static void mask_and_ack_8259A(unsigned int irq)
         * Lightweight spurious IRQ detection. We do not want
         * to overdo spurious IRQ handling - it's usually a sign
         * of hardware problems, so we only do the checks we can
-        * do without slowing down good hardware unnecesserily.
+        * do without slowing down good hardware unnecessarily.
         *
         * Note that IRQ7 and IRQ15 (the two spurious IRQs
         * usually resulting from the 8259A-1|2 PICs) occur
@@ -492,9 +492,10 @@ void invalidate_interrupt5(void);
 void invalidate_interrupt6(void);
 void invalidate_interrupt7(void);
 void thermal_interrupt(void);
+void threshold_interrupt(void);
 void i8254_timer_resume(void);
 
-static void setup_timer(void)
+static void setup_timer_hardware(void)
 {
        outb_p(0x34,0x43);              /* binary, mode 2, LSB/MSB, ch 0 */
        udelay(10);
@@ -505,17 +506,17 @@ static void setup_timer(void)
 
 static int timer_resume(struct sys_device *dev)
 {
-       setup_timer();
+       setup_timer_hardware();
        return 0;
 }
 
 void i8254_timer_resume(void)
 {
-       setup_timer();
+       setup_timer_hardware();
 }
 
 static struct sysdev_class timer_sysclass = {
-       set_kset_name("timer"),
+       set_kset_name("timer_pit"),
        .resume         = timer_resume,
 };
 
@@ -548,10 +549,9 @@ void __init init_IRQ(void)
                int vector = FIRST_EXTERNAL_VECTOR + i;
                if (i >= NR_IRQS)
                        break;
-               if (vector != IA32_SYSCALL_VECTOR && vector != KDB_VECTOR) { 
+               if (vector != IA32_SYSCALL_VECTOR)
                        set_intr_gate(vector, interrupt[i]);
        }
-       }
 
 #ifdef CONFIG_SMP
        /*
@@ -580,6 +580,7 @@ void __init init_IRQ(void)
        set_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt);
 #endif 
        set_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt);
+       set_intr_gate(THRESHOLD_APIC_VECTOR, threshold_interrupt);
 
 #ifdef CONFIG_X86_LOCAL_APIC
        /* self generated IPI for local APIC timer */
@@ -594,7 +595,7 @@ void __init init_IRQ(void)
         * Set the clock to HZ Hz, we already have a valid
         * vector now:
         */
-       setup_timer();
+       setup_timer_hardware();
 
        if (!acpi_ioapic)
                setup_irq(2, &irq2);