aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoff Levand <geoffrey.levand@am.sony.com>2007-06-15 18:06:09 -0400
committerPaul Mackerras <paulus@samba.org>2007-06-28 05:16:45 -0400
commita354ab8557566e9462ea7af20345f6927e6665b3 (patch)
tree590eb787e150011acd5ca83dd554e2c56341af43
parentaab835007097122c3a1e7a7dddda0cf89a94cd4e (diff)
[POWERPC] PS3: Use clear_bit
Replace the inline asm with bitops in the PS3 interrupt chip mask routines. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/platforms/ps3/interrupt.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/arch/powerpc/platforms/ps3/interrupt.c b/arch/powerpc/platforms/ps3/interrupt.c
index e2de899d7463..67e32ec9b37e 100644
--- a/arch/powerpc/platforms/ps3/interrupt.c
+++ b/arch/powerpc/platforms/ps3/interrupt.c
@@ -100,24 +100,13 @@ static DEFINE_PER_CPU(struct ps3_private, ps3_private);
100static void ps3_chip_mask(unsigned int virq) 100static void ps3_chip_mask(unsigned int virq)
101{ 101{
102 struct ps3_private *pd = get_irq_chip_data(virq); 102 struct ps3_private *pd = get_irq_chip_data(virq);
103 u64 bit = 0x8000000000000000UL >> virq;
104 u64 *p = &pd->bmp.mask;
105 u64 old;
106 unsigned long flags; 103 unsigned long flags;
107 104
108 pr_debug("%s:%d: thread_id %lu, virq %d\n", __func__, __LINE__, 105 pr_debug("%s:%d: thread_id %lu, virq %d\n", __func__, __LINE__,
109 pd->thread_id, virq); 106 pd->thread_id, virq);
110 107
111 local_irq_save(flags); 108 local_irq_save(flags);
112 asm volatile( 109 clear_bit(63 - virq, &pd->bmp.mask);
113 "1: ldarx %0,0,%3\n"
114 "andc %0,%0,%2\n"
115 "stdcx. %0,0,%3\n"
116 "bne- 1b"
117 : "=&r" (old), "+m" (*p)
118 : "r" (bit), "r" (p)
119 : "cc" );
120
121 lv1_did_update_interrupt_mask(pd->ppe_id, pd->thread_id); 110 lv1_did_update_interrupt_mask(pd->ppe_id, pd->thread_id);
122 local_irq_restore(flags); 111 local_irq_restore(flags);
123} 112}
@@ -132,24 +121,13 @@ static void ps3_chip_mask(unsigned int virq)
132static void ps3_chip_unmask(unsigned int virq) 121static void ps3_chip_unmask(unsigned int virq)
133{ 122{
134 struct ps3_private *pd = get_irq_chip_data(virq); 123 struct ps3_private *pd = get_irq_chip_data(virq);
135 u64 bit = 0x8000000000000000UL >> virq;
136 u64 *p = &pd->bmp.mask;
137 u64 old;
138 unsigned long flags; 124 unsigned long flags;
139 125
140 pr_debug("%s:%d: thread_id %lu, virq %d\n", __func__, __LINE__, 126 pr_debug("%s:%d: thread_id %lu, virq %d\n", __func__, __LINE__,
141 pd->thread_id, virq); 127 pd->thread_id, virq);
142 128
143 local_irq_save(flags); 129 local_irq_save(flags);
144 asm volatile( 130 set_bit(63 - virq, &pd->bmp.mask);
145 "1: ldarx %0,0,%3\n"
146 "or %0,%0,%2\n"
147 "stdcx. %0,0,%3\n"
148 "bne- 1b"
149 : "=&r" (old), "+m" (*p)
150 : "r" (bit), "r" (p)
151 : "cc" );
152
153 lv1_did_update_interrupt_mask(pd->ppe_id, pd->thread_id); 131 lv1_did_update_interrupt_mask(pd->ppe_id, pd->thread_id);
154 local_irq_restore(flags); 132 local_irq_restore(flags);
155} 133}