Pull thermal into release branch
[linux-drm-fsl-dcu.git] / arch / m68k / kernel / ints.c
index b33e37fb7b0e4eb88a78bfdfb282be42c1c9e61c..60d4d75f5798692b7a4ce4c9c019df6cf323650e 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/sched.h>
+#include <linux/interrupt.h>
 #include <linux/kernel_stat.h>
 #include <linux/errno.h>
 #include <linux/init.h>
@@ -39,6 +40,7 @@
 #include <asm/page.h>
 #include <asm/machdep.h>
 #include <asm/cacheflush.h>
+#include <asm/irq_regs.h>
 
 #ifdef CONFIG_Q40
 #include <asm/q40ints.h>
@@ -57,14 +59,14 @@ static int m68k_first_user_vec;
 
 static struct irq_controller auto_irq_controller = {
        .name           = "auto",
-       .lock           = SPIN_LOCK_UNLOCKED,
+       .lock           = __SPIN_LOCK_UNLOCKED(auto_irq_controller.lock),
        .startup        = m68k_irq_startup,
        .shutdown       = m68k_irq_shutdown,
 };
 
 static struct irq_controller user_irq_controller = {
        .name           = "user",
-       .lock           = SPIN_LOCK_UNLOCKED,
+       .lock           = __SPIN_LOCK_UNLOCKED(user_irq_controller.lock),
        .startup        = m68k_irq_startup,
        .shutdown       = m68k_irq_shutdown,
 };
@@ -104,7 +106,7 @@ void __init init_IRQ(void)
  * @handler: called from auto vector interrupts
  *
  * setup the handler to be called from auto vector interrupts instead of the
- * standard m68k_handle_int(), it will be called with irq numbers in the range
+ * standard __m68k_handle_int(), it will be called with irq numbers in the range
  * from IRQ_AUTO_1 - IRQ_AUTO_7.
  */
 void __init m68k_setup_auto_interrupt(void (*handler)(unsigned int, struct pt_regs *))
@@ -123,7 +125,7 @@ void __init m68k_setup_auto_interrupt(void (*handler)(unsigned int, struct pt_re
  * setup user vector interrupts, this includes activating the specified range
  * of interrupts, only then these interrupts can be requested (note: this is
  * different from auto vector interrupts). An optional handler can be installed
- * to be called instead of the default m68k_handle_int(), it will be called
+ * to be called instead of the default __m68k_handle_int(), it will be called
  * with irq numbers starting from IRQ_USER.
  */
 void __init m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt,
@@ -131,6 +133,7 @@ void __init m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt,
 {
        int i;
 
+       BUG_ON(IRQ_USER + cnt >= NR_IRQS);
        m68k_first_user_vec = vec;
        for (i = 0; i < cnt; i++)
                irq_controller[IRQ_USER + i] = &user_irq_controller;
@@ -215,7 +218,7 @@ int setup_irq(unsigned int irq, struct irq_node *node)
 }
 
 int request_irq(unsigned int irq,
-               irqreturn_t (*handler) (int, void *, struct pt_regs *),
+               irq_handler_t handler,
                unsigned long flags, const char *devname, void *dev_id)
 {
        struct irq_node *node;
@@ -379,18 +382,25 @@ unsigned int irq_canonicalize(unsigned int irq)
 
 EXPORT_SYMBOL(irq_canonicalize);
 
-asmlinkage void m68k_handle_int(unsigned int irq, struct pt_regs *regs)
+asmlinkage void m68k_handle_int(unsigned int irq)
 {
        struct irq_node *node;
-
        kstat_cpu(0).irqs[irq]++;
        node = irq_list[irq];
        do {
-               node->handler(irq, node->dev_id, regs);
+               node->handler(irq, node->dev_id);
                node = node->next;
        } while (node);
 }
 
+asmlinkage void __m68k_handle_int(unsigned int irq, struct pt_regs *regs)
+{
+       struct pt_regs *old_regs;
+       old_regs = set_irq_regs(regs);
+       m68k_handle_int(irq);
+       set_irq_regs(old_regs);
+}
+
 asmlinkage void handle_badint(struct pt_regs *regs)
 {
        kstat_cpu(0).irqs[0]++;