]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/platforms/pseries/xics.c
powerpc: convert to generic helpers for IPI function calls
[linux-2.6-omap-h63xx.git] / arch / powerpc / platforms / pseries / xics.c
index c3f05d4aff4d09fb2ac314b2d43d6d067ea19ddc..0fc830f576f5532870157af81cdaf4c65625b67d 100644 (file)
@@ -9,7 +9,6 @@
  *  2 of the License, or (at your option) any later version.
  */
 
-#undef DEBUG
 
 #include <linux/types.h>
 #include <linux/threads.h>
@@ -384,13 +383,11 @@ static irqreturn_t xics_ipi_dispatch(int cpu)
                        mb();
                        smp_message_recv(PPC_MSG_RESCHEDULE);
                }
-#if 0
-               if (test_and_clear_bit(PPC_MSG_MIGRATE_TASK,
+               if (test_and_clear_bit(PPC_MSG_CALL_FUNC_SINGLE,
                                       &xics_ipi_message[cpu].value)) {
                        mb();
-                       smp_message_recv(PPC_MSG_MIGRATE_TASK);
+                       smp_message_recv(PPC_MSG_CALL_FUNC_SINGLE);
                }
-#endif
 #if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC)
                if (test_and_clear_bit(PPC_MSG_DEBUGGER_BREAK,
                                       &xics_ipi_message[cpu].value)) {
@@ -516,6 +513,8 @@ static struct irq_chip xics_pic_lpar = {
        .set_affinity = xics_set_affinity
 };
 
+/* Points to the irq_chip we're actually using */
+static struct irq_chip *xics_irq_chip;
 
 static int xics_host_match(struct irq_host *h, struct device_node *node)
 {
@@ -526,23 +525,13 @@ static int xics_host_match(struct irq_host *h, struct device_node *node)
        return !of_device_is_compatible(node, "chrp,iic");
 }
 
-static int xics_host_map_direct(struct irq_host *h, unsigned int virq,
-                               irq_hw_number_t hw)
-{
-       pr_debug("xics: map_direct virq %d, hwirq 0x%lx\n", virq, hw);
-
-       get_irq_desc(virq)->status |= IRQ_LEVEL;
-       set_irq_chip_and_handler(virq, &xics_pic_direct, handle_fasteoi_irq);
-       return 0;
-}
-
-static int xics_host_map_lpar(struct irq_host *h, unsigned int virq,
-                             irq_hw_number_t hw)
+static int xics_host_map(struct irq_host *h, unsigned int virq,
+                        irq_hw_number_t hw)
 {
-       pr_debug("xics: map_direct virq %d, hwirq 0x%lx\n", virq, hw);
+       pr_debug("xics: map virq %d, hwirq 0x%lx\n", virq, hw);
 
        get_irq_desc(virq)->status |= IRQ_LEVEL;
-       set_irq_chip_and_handler(virq, &xics_pic_lpar, handle_fasteoi_irq);
+       set_irq_chip_and_handler(virq, xics_irq_chip, handle_fasteoi_irq);
        return 0;
 }
 
@@ -561,27 +550,20 @@ static int xics_host_xlate(struct irq_host *h, struct device_node *ct,
        return 0;
 }
 
-static struct irq_host_ops xics_host_direct_ops = {
+static struct irq_host_ops xics_host_ops = {
        .match = xics_host_match,
-       .map = xics_host_map_direct,
-       .xlate = xics_host_xlate,
-};
-
-static struct irq_host_ops xics_host_lpar_ops = {
-       .match = xics_host_match,
-       .map = xics_host_map_lpar,
+       .map = xics_host_map,
        .xlate = xics_host_xlate,
 };
 
 static void __init xics_init_host(void)
 {
-       struct irq_host_ops *ops;
-
        if (firmware_has_feature(FW_FEATURE_LPAR))
-               ops = &xics_host_lpar_ops;
+               xics_irq_chip = &xics_pic_lpar;
        else
-               ops = &xics_host_direct_ops;
-       xics_host = irq_alloc_host(NULL, IRQ_HOST_MAP_TREE, 0, ops,
+               xics_irq_chip = &xics_pic_direct;
+
+       xics_host = irq_alloc_host(NULL, IRQ_HOST_MAP_TREE, 0, &xics_host_ops,
                                   XICS_IRQ_SPURIOUS);
        BUG_ON(xics_host == NULL);
        irq_set_default_host(xics_host);