]> err.no Git - linux-2.6/commitdiff
[POWERPC] PS3: Move chip mask defs up
authorGeoff Levand <geoffrey.levand@am.sony.com>
Fri, 15 Jun 2007 21:19:18 +0000 (07:19 +1000)
committerPaul Mackerras <paulus@samba.org>
Thu, 28 Jun 2007 09:16:36 +0000 (19:16 +1000)
This just moves the definitions of the PS3 chip_mask routines up
above the irq setup routines.  This change is needed for the
kexec updates that follow.  Also adds some inline documentation
to the routines.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/platforms/ps3/interrupt.c

index b050fc4cd883c32edeeee2331f5f129f98161559..c9fd4ed66e8f09e8ee7db444e074126582a301d2 100644 (file)
@@ -90,6 +90,92 @@ struct ps3_private {
 
 static DEFINE_PER_CPU(struct ps3_private, ps3_private);
 
+/**
+ * ps3_chip_mask - Set an interrupt mask bit in ps3_bmp.
+ * @virq: The assigned Linux virq.
+ *
+ * Sets ps3_bmp.mask and calls lv1_did_update_interrupt_mask().
+ */
+
+static void ps3_chip_mask(unsigned int virq)
+{
+       struct ps3_private *pd = get_irq_chip_data(virq);
+       u64 bit = 0x8000000000000000UL >> virq;
+       u64 *p = &pd->bmp.mask;
+       u64 old;
+       unsigned long flags;
+
+       pr_debug("%s:%d: cpu %u, virq %d\n", __func__, __LINE__, pd->cpu, virq);
+
+       local_irq_save(flags);
+       asm volatile(
+                    "1:        ldarx %0,0,%3\n"
+                    "andc      %0,%0,%2\n"
+                    "stdcx.    %0,0,%3\n"
+                    "bne-      1b"
+                    : "=&r" (old), "+m" (*p)
+                    : "r" (bit), "r" (p)
+                    : "cc" );
+
+       lv1_did_update_interrupt_mask(pd->node, pd->cpu);
+       local_irq_restore(flags);
+}
+
+/**
+ * ps3_chip_unmask - Clear an interrupt mask bit in ps3_bmp.
+ * @virq: The assigned Linux virq.
+ *
+ * Clears ps3_bmp.mask and calls lv1_did_update_interrupt_mask().
+ */
+
+static void ps3_chip_unmask(unsigned int virq)
+{
+       struct ps3_private *pd = get_irq_chip_data(virq);
+       u64 bit = 0x8000000000000000UL >> virq;
+       u64 *p = &pd->bmp.mask;
+       u64 old;
+       unsigned long flags;
+
+       pr_debug("%s:%d: cpu %u, virq %d\n", __func__, __LINE__, pd->cpu, virq);
+
+       local_irq_save(flags);
+       asm volatile(
+                    "1:        ldarx %0,0,%3\n"
+                    "or        %0,%0,%2\n"
+                    "stdcx.    %0,0,%3\n"
+                    "bne-      1b"
+                    : "=&r" (old), "+m" (*p)
+                    : "r" (bit), "r" (p)
+                    : "cc" );
+
+       lv1_did_update_interrupt_mask(pd->node, pd->cpu);
+       local_irq_restore(flags);
+}
+
+/**
+ * ps3_chip_eoi - HV end-of-interrupt.
+ * @virq: The assigned Linux virq.
+ *
+ * Calls lv1_end_of_interrupt_ext().
+ */
+
+static void ps3_chip_eoi(unsigned int virq)
+{
+       const struct ps3_private *pd = get_irq_chip_data(virq);
+       lv1_end_of_interrupt_ext(pd->node, pd->cpu, virq);
+}
+
+/**
+ * ps3_irq_chip - Represents the ps3_bmp as a Linux struct irq_chip.
+ */
+
+static struct irq_chip ps3_irq_chip = {
+       .typename = "ps3",
+       .mask = ps3_chip_mask,
+       .unmask = ps3_chip_unmask,
+       .eoi = ps3_chip_eoi,
+};
+
 /**
  * ps3_virq_setup - virq related setup.
  * @cpu: enum ps3_cpu_binding indicating the cpu the interrupt should be
@@ -565,67 +651,6 @@ static void __maybe_unused _dump_mask(struct ps3_private *pd,
 static void dump_bmp(struct ps3_private* pd) {};
 #endif /* defined(DEBUG) */
 
-static void ps3_chip_mask(unsigned int virq)
-{
-       struct ps3_private *pd = get_irq_chip_data(virq);
-       u64 bit = 0x8000000000000000UL >> virq;
-       u64 *p = &pd->bmp.mask;
-       u64 old;
-       unsigned long flags;
-
-       pr_debug("%s:%d: cpu %u, virq %d\n", __func__, __LINE__, pd->cpu, virq);
-
-       local_irq_save(flags);
-       asm volatile(
-                    "1:        ldarx %0,0,%3\n"
-                    "andc      %0,%0,%2\n"
-                    "stdcx.    %0,0,%3\n"
-                    "bne-      1b"
-                    : "=&r" (old), "+m" (*p)
-                    : "r" (bit), "r" (p)
-                    : "cc" );
-
-       lv1_did_update_interrupt_mask(pd->node, pd->cpu);
-       local_irq_restore(flags);
-}
-
-static void ps3_chip_unmask(unsigned int virq)
-{
-       struct ps3_private *pd = get_irq_chip_data(virq);
-       u64 bit = 0x8000000000000000UL >> virq;
-       u64 *p = &pd->bmp.mask;
-       u64 old;
-       unsigned long flags;
-
-       pr_debug("%s:%d: cpu %u, virq %d\n", __func__, __LINE__, pd->cpu, virq);
-
-       local_irq_save(flags);
-       asm volatile(
-                    "1:        ldarx %0,0,%3\n"
-                    "or        %0,%0,%2\n"
-                    "stdcx.    %0,0,%3\n"
-                    "bne-      1b"
-                    : "=&r" (old), "+m" (*p)
-                    : "r" (bit), "r" (p)
-                    : "cc" );
-
-       lv1_did_update_interrupt_mask(pd->node, pd->cpu);
-       local_irq_restore(flags);
-}
-
-static void ps3_chip_eoi(unsigned int virq)
-{
-       const struct ps3_private *pd = get_irq_chip_data(virq);
-       lv1_end_of_interrupt_ext(pd->node, pd->cpu, virq);
-}
-
-static struct irq_chip irq_chip = {
-       .typename = "ps3",
-       .mask = ps3_chip_mask,
-       .unmask = ps3_chip_unmask,
-       .eoi = ps3_chip_eoi,
-};
-
 static void ps3_host_unmap(struct irq_host *h, unsigned int virq)
 {
        set_irq_chip_data(virq, NULL);