Merge branch 'exec_rm_compat' of git://git.kernel.org/pub/scm/linux/kernel/git/oleg...
[pandora-kernel.git] / arch / sparc / kernel / irq_64.c
index 3c8b266..4e78862 100644 (file)
@@ -162,47 +162,14 @@ void irq_free(unsigned int irq)
 /*
  * /proc/interrupts printing:
  */
-
-int show_interrupts(struct seq_file *p, void *v)
+int arch_show_interrupts(struct seq_file *p, int prec)
 {
-       int i = *(loff_t *) v, j;
-       struct irqaction * action;
-       unsigned long flags;
+       int j;
 
-       if (i == 0) {
-               seq_printf(p, "           ");
-               for_each_online_cpu(j)
-                       seq_printf(p, "CPU%d       ",j);
-               seq_putc(p, '\n');
-       }
-
-       if (i < NR_IRQS) {
-               raw_spin_lock_irqsave(&irq_desc[i].lock, flags);
-               action = irq_desc[i].action;
-               if (!action)
-                       goto skip;
-               seq_printf(p, "%3d: ",i);
-#ifndef CONFIG_SMP
-               seq_printf(p, "%10u ", kstat_irqs(i));
-#else
-               for_each_online_cpu(j)
-                       seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
-#endif
-               seq_printf(p, " %9s", irq_desc[i].irq_data.chip->name);
-               seq_printf(p, "  %s", action->name);
-
-               for (action=action->next; action; action = action->next)
-                       seq_printf(p, ", %s", action->name);
-
-               seq_putc(p, '\n');
-skip:
-               raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags);
-       } else if (i == NR_IRQS) {
-               seq_printf(p, "NMI: ");
-               for_each_online_cpu(j)
-                       seq_printf(p, "%10u ", cpu_data(j).__nmi_count);
-               seq_printf(p, "     Non-maskable interrupts\n");
-       }
+       seq_printf(p, "NMI: ");
+       for_each_online_cpu(j)
+               seq_printf(p, "%10u ", cpu_data(j).__nmi_count);
+       seq_printf(p, "     Non-maskable interrupts\n");
        return 0;
 }
 
@@ -257,13 +224,13 @@ static int irq_choose_cpu(unsigned int irq, const struct cpumask *affinity)
        int cpuid;
 
        cpumask_copy(&mask, affinity);
-       if (cpus_equal(mask, cpu_online_map)) {
+       if (cpumask_equal(&mask, cpu_online_mask)) {
                cpuid = map_to_cpu(irq);
        } else {
                cpumask_t tmp;
 
-               cpus_and(tmp, cpu_online_map, mask);
-               cpuid = cpus_empty(tmp) ? map_to_cpu(irq) : first_cpu(tmp);
+               cpumask_and(&tmp, cpu_online_mask, &mask);
+               cpuid = cpumask_empty(&tmp) ? map_to_cpu(irq) : cpumask_first(&tmp);
        }
 
        return cpuid;
@@ -526,7 +493,7 @@ void irq_install_pre_handler(int irq,
                             void (*func)(unsigned int, void *, void *),
                             void *arg1, void *arg2)
 {
-       struct irq_handler_data *handler_data = get_irq_data(irq);
+       struct irq_handler_data *handler_data = irq_get_handler_data(irq);
 
        handler_data->pre_handler = func;
        handler_data->arg1 = arg1;
@@ -550,13 +517,11 @@ unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap)
        if (!irq) {
                irq = irq_alloc(0, ino);
                bucket_set_irq(__pa(bucket), irq);
-               set_irq_chip_and_handler_name(irq,
-                                             &sun4u_irq,
-                                             handle_fasteoi_irq,
-                                             "IVEC");
+               irq_set_chip_and_handler_name(irq, &sun4u_irq,
+                                             handle_fasteoi_irq, "IVEC");
        }
 
-       handler_data = get_irq_data(irq);
+       handler_data = irq_get_handler_data(irq);
        if (unlikely(handler_data))
                goto out;
 
@@ -565,7 +530,7 @@ unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap)
                prom_printf("IRQ: kzalloc(irq_handler_data) failed.\n");
                prom_halt();
        }
-       set_irq_data(irq, handler_data);
+       irq_set_handler_data(irq, handler_data);
 
        handler_data->imap  = imap;
        handler_data->iclr  = iclr;
@@ -588,12 +553,11 @@ static unsigned int sun4v_build_common(unsigned long sysino,
        if (!irq) {
                irq = irq_alloc(0, sysino);
                bucket_set_irq(__pa(bucket), irq);
-               set_irq_chip_and_handler_name(irq, chip,
-                                             handle_fasteoi_irq,
+               irq_set_chip_and_handler_name(irq, chip, handle_fasteoi_irq,
                                              "IVEC");
        }
 
-       handler_data = get_irq_data(irq);
+       handler_data = irq_get_handler_data(irq);
        if (unlikely(handler_data))
                goto out;
 
@@ -602,7 +566,7 @@ static unsigned int sun4v_build_common(unsigned long sysino,
                prom_printf("IRQ: kzalloc(irq_handler_data) failed.\n");
                prom_halt();
        }
-       set_irq_data(irq, handler_data);
+       irq_set_handler_data(irq, handler_data);
 
        /* Catch accidental accesses to these things.  IMAP/ICLR handling
         * is done by hypervisor calls on sun4v platforms, not by direct
@@ -627,7 +591,6 @@ unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino)
        struct irq_handler_data *handler_data;
        unsigned long hv_err, cookie;
        struct ino_bucket *bucket;
-       struct irq_desc *desc;
        unsigned int irq;
 
        bucket = kzalloc(sizeof(struct ino_bucket), GFP_ATOMIC);
@@ -648,8 +611,7 @@ unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino)
        irq = irq_alloc(devhandle, devino);
        bucket_set_irq(__pa(bucket), irq);
 
-       set_irq_chip_and_handler_name(irq, &sun4v_virq,
-                                     handle_fasteoi_irq,
+       irq_set_chip_and_handler_name(irq, &sun4v_virq, handle_fasteoi_irq,
                                      "IVEC");
 
        handler_data = kzalloc(sizeof(struct irq_handler_data), GFP_ATOMIC);
@@ -660,10 +622,8 @@ unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino)
         * especially wrt. locking, we do not let request_irq() enable
         * the interrupt.
         */
-       desc = irq_desc + irq;
-       desc->status |= IRQ_NOAUTOEN;
-
-       set_irq_data(irq, handler_data);
+       irq_set_status_flags(irq, IRQ_NOAUTOEN);
+       irq_set_handler_data(irq, handler_data);
 
        /* Catch accidental accesses to these things.  IMAP/ICLR handling
         * is done by hypervisor calls on sun4v platforms, not by direct
@@ -772,19 +732,18 @@ void fixup_irqs(void)
        unsigned int irq;
 
        for (irq = 0; irq < NR_IRQS; irq++) {
+               struct irq_desc *desc = irq_to_desc(irq);
+               struct irq_data *data = irq_desc_get_irq_data(desc);
                unsigned long flags;
 
-               raw_spin_lock_irqsave(&irq_desc[irq].lock, flags);
-               if (irq_desc[irq].action &&
-                   !(irq_desc[irq].status & IRQ_PER_CPU)) {
-                       struct irq_data *data = irq_get_irq_data(irq);
-
+               raw_spin_lock_irqsave(&desc->lock, flags);
+               if (desc->action && !irqd_is_per_cpu(data)) {
                        if (data->chip->irq_set_affinity)
                                data->chip->irq_set_affinity(data,
-                                                            data->affinity,
-                                                            false);
+                                                            data->affinity,
+                                                            false);
                }
-               raw_spin_unlock_irqrestore(&irq_desc[irq].lock, flags);
+               raw_spin_unlock_irqrestore(&desc->lock, flags);
        }
 
        tick_ops->disable_irq();
@@ -1022,5 +981,5 @@ void __init init_IRQ(void)
                             : "i" (PSTATE_IE)
                             : "g1");
 
-       irq_desc[0].action = &timer_irq_action;
+       irq_to_desc(0)->action = &timer_irq_action;
 }