[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>
This commit is contained in:
@@ -544,10 +544,10 @@ static unsigned int sabre_irq_build(struct pci_pbm_info *pbm,
|
||||
struct pci_dev *pdev,
|
||||
unsigned int ino)
|
||||
{
|
||||
struct ino_bucket *bucket;
|
||||
unsigned long imap, iclr;
|
||||
unsigned long imap_off, iclr_off;
|
||||
int inofixup = 0;
|
||||
int virt_irq;
|
||||
|
||||
ino &= PCI_IRQ_INO;
|
||||
if (ino < SABRE_ONBOARD_IRQ_BASE) {
|
||||
@@ -573,23 +573,23 @@ static unsigned int sabre_irq_build(struct pci_pbm_info *pbm,
|
||||
if ((ino & 0x20) == 0)
|
||||
inofixup = ino & 0x03;
|
||||
|
||||
bucket = __bucket(build_irq(inofixup, iclr, imap));
|
||||
bucket->flags |= IBF_PCI;
|
||||
virt_irq = build_irq(inofixup, iclr, imap, IBF_PCI);
|
||||
|
||||
if (pdev) {
|
||||
struct pcidev_cookie *pcp = pdev->sysdata;
|
||||
|
||||
if (pdev->bus->number != pcp->pbm->pci_first_busno) {
|
||||
struct pci_controller_info *p = pcp->pbm->parent;
|
||||
struct irq_desc *d = bucket->irq_info;
|
||||
|
||||
d->pre_handler = sabre_wsync_handler;
|
||||
d->pre_handler_arg1 = pdev;
|
||||
d->pre_handler_arg2 = (void *)
|
||||
p->pbm_A.controller_regs + SABRE_WRSYNC;
|
||||
irq_install_pre_handler(virt_irq,
|
||||
sabre_wsync_handler,
|
||||
pdev,
|
||||
(void *)
|
||||
p->pbm_A.controller_regs +
|
||||
SABRE_WRSYNC);
|
||||
}
|
||||
}
|
||||
return __irq(bucket);
|
||||
return virt_irq;
|
||||
}
|
||||
|
||||
/* SABRE error handling support. */
|
||||
|
Reference in New Issue
Block a user