summaryrefslogtreecommitdiff
path: root/include/asm-sparc64/irq.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2006-06-20 01:22:35 -0700
committerDavid S. Miller <davem@davemloft.net>2006-06-20 01:22:35 -0700
commit8047e247c899f80c33a23ad7e9e250224f0d26a5 (patch)
tree253a7ba3c902730928214df5c2b5630d7875cc11 /include/asm-sparc64/irq.h
parent37cdcd9e82108f9b899f1631f66ade2e45738a6e (diff)
[SPARC64]: Virtualize IRQ numbers.
Inspired by PowerPC XICS interrupt support code. All IRQs are virtualized in order to keep NR_IRQS from needing to be too large. Interrupts on sparc64 are arbitrary 11-bit values, but we don't need to define NR_IRQS to 2048 if we virtualize the IRQs. As PCI and SBUS controller drivers build device IRQs, we divy out virtual IRQ numbers incrementally starting at 1. Zero is a special virtual IRQ used for the timer interrupt. So device drivers all see virtual IRQs, and all the normal interfaces such as request_irq(), enable_irq(), etc. translate that into a real IRQ number in order to configure the IRQ. At this point knowledge of the struct ino_bucket is almost entirely contained within arch/sparc64/kernel/irq.c There are a few small bits in the PCI controller drivers that need to be swept away before we can remove ino_bucket's definition out of asm-sparc64/irq.h and privately into kernel/irq.c Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/asm-sparc64/irq.h')
-rw-r--r--include/asm-sparc64/irq.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/asm-sparc64/irq.h b/include/asm-sparc64/irq.h
index d66c7cd820c2..9edcd90495f7 100644
--- a/include/asm-sparc64/irq.h
+++ b/include/asm-sparc64/irq.h
@@ -98,13 +98,22 @@ extern struct ino_bucket ivector_table[NUM_IVECS];
#define __bucket(irq) ((struct ino_bucket *)(unsigned long)(irq))
#define __irq(bucket) ((unsigned int)(unsigned long)(bucket))
-#define NR_IRQS 16
+/* The largest number of unique interrupt sources we support.
+ * If this needs to ever be larger than 255, you need to change
+ * the type of ino_bucket->virt_irq as appropriate.
+ *
+ * ino_bucket->virt_irq allocation is made during {sun4v_,}build_irq().
+ */
+#define NR_IRQS 255
+extern void irq_install_pre_handler(int virt_irq,
+ void (*func)(struct ino_bucket *, void *, void *),
+ void *arg1, void *arg2);
#define irq_canonicalize(irq) (irq)
extern void disable_irq(unsigned int);
#define disable_irq_nosync disable_irq
extern void enable_irq(unsigned int);
-extern unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap);
+extern unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap, unsigned char flags);
extern unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino, unsigned char flags);
extern unsigned int sbus_build_irq(void *sbus, unsigned int ino);