aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel
diff options
context:
space:
mode:
authorJeffrey Deans <jeffrey.deans@imgtec.com>2014-07-17 04:20:57 -0400
committerRalf Baechle <ralf@linux-mips.org>2014-08-01 18:06:41 -0400
commit31521a7a64bc5df5202e479ee7ba8133993ab32a (patch)
treeb0ce7b225598ff2d1890758078c61660e0480cff /arch/mips/kernel
parent6096e114f5f70d29d9e01e031f69d529b2193ab7 (diff)
MIPS: GIC: Generalise check for pending interrupts
Move most of the functionality of gic_get_int() into a new function gic_get_int_mask() which takes a bitmask of interrupts in which the caller is interested, and returns the subset which are pending for the current CPU. This allows CP0 IRQ dispatch routines to check only the GIC interrupts which are routed to a particular CPU interrupt input. gic_get_int() is reimplemented using gic_get_int_mask() and is retained for use by any platforms for which gic_get_int() is sufficient. Signed-off-by: Jeffrey Deans <jeffrey.deans@imgtec.com> Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/7376/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r--arch/mips/kernel/irq-gic.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/mips/kernel/irq-gic.c b/arch/mips/kernel/irq-gic.c
index 9932aef91abb..9e9d8b9a5b97 100644
--- a/arch/mips/kernel/irq-gic.c
+++ b/arch/mips/kernel/irq-gic.c
@@ -189,7 +189,7 @@ unsigned int gic_compare_int(void)
189 return 0; 189 return 0;
190} 190}
191 191
192unsigned int gic_get_int(void) 192void gic_get_int_mask(unsigned long *dst, const unsigned long *src)
193{ 193{
194 unsigned int i; 194 unsigned int i;
195 unsigned long *pending, *intrmask, *pcpu_mask; 195 unsigned long *pending, *intrmask, *pcpu_mask;
@@ -214,8 +214,17 @@ unsigned int gic_get_int(void)
214 214
215 bitmap_and(pending, pending, intrmask, GIC_NUM_INTRS); 215 bitmap_and(pending, pending, intrmask, GIC_NUM_INTRS);
216 bitmap_and(pending, pending, pcpu_mask, GIC_NUM_INTRS); 216 bitmap_and(pending, pending, pcpu_mask, GIC_NUM_INTRS);
217 bitmap_and(dst, src, pending, GIC_NUM_INTRS);
218}
219
220unsigned int gic_get_int(void)
221{
222 DECLARE_BITMAP(interrupts, GIC_NUM_INTRS);
223
224 bitmap_fill(interrupts, GIC_NUM_INTRS);
225 gic_get_int_mask(interrupts, interrupts);
217 226
218 return find_first_bit(pending, GIC_NUM_INTRS); 227 return find_first_bit(interrupts, GIC_NUM_INTRS);
219} 228}
220 229
221static void gic_mask_irq(struct irq_data *d) 230static void gic_mask_irq(struct irq_data *d)