summaryrefslogtreecommitdiffstats
path: root/drivers/sh/intc/internals.h
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2012-01-24 17:41:55 +0900
committerPaul Mundt <lethal@linux-sh.org>2012-01-24 17:41:55 +0900
commitb59f9f9775e643435bba76e30e59e47c19c56dee (patch)
tree55bc067e5d2da0fc01ef9808ded60d9234dde165 /drivers/sh/intc/internals.h
parent30377642138aadeef35a31c2f90dba0b6fa7b91a (diff)
sh: intc: optimize intc IRQ lookup
This ensures that the sense/prio lists are sorted at registration time, enabling us to use a simple binary search for an optimized lookup (something that had been on the TODO for some time). Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/sh/intc/internals.h')
-rw-r--r--drivers/sh/intc/internals.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/sh/intc/internals.h b/drivers/sh/intc/internals.h
index 422b72df089..f034a979a16 100644
--- a/drivers/sh/intc/internals.h
+++ b/drivers/sh/intc/internals.h
@@ -108,6 +108,14 @@ static inline void activate_irq(int irq)
#endif
}
+static inline int intc_handle_int_cmp(const void *a, const void *b)
+{
+ const struct intc_handle_int *_a = a;
+ const struct intc_handle_int *_b = b;
+
+ return _a->irq - _b->irq;
+}
+
/* access.c */
extern unsigned long
(*intc_reg_fns[])(unsigned long addr, unsigned long h, unsigned long data);