You copied the Doc URL to your clipboard.

A.5.4. Interrupt routing

The Integrator-specific interrupt routing code uses a static routing table, as shown in Example A.21. This provides the generic PCI code with mapping of the interrupt numbers, the slot a device occupies, and the interrupt pin it uses.

unsigned char uHALir_PCIMapInterrupt(unsigned char pin, unsigned char slot) {
 #define INTA IRQ_PCIINT0
 #define INTB IRQ_PCIINT1
 #define INTC IRQ_PCIINT2
 #define INTD IRQ_PCIINT3

//DANGER! For now this is the SDM interrupt table...
    char irq_tab[12][4] = {
    // INTA  INTB  INTC  INTD
    {  INTA, INTB, INTC, INTD },     // idsel 20, slot 9
    {  INTB, INTC, INTD, INTA },    // idsel 21, slot 10
    {  INTC, INTD, INTA, INTB },    // idsel 22, slot 11
    {  INTD, INTA, INTB, INTC },    // idsel 23, slot 12
    {  INTA, INTB, INTC, INTD },    // idsel 24, slot 13
    {  INTB, INTC, INTD, INTA },    // idsel 25, slot 14
    {  INTC, INTD, INTA, INTB },    // idsel 26, slot 15
    {  INTD, INTA, INTB, INTC },    // idsel 27, slot 16
    {  INTA, INTB, INTC, INTD },    // idsel 28, slot 17
    {  INTB, INTC, INTD, INTA },    // idsel 29, slot 18
    {  INTC, INTD, INTA, INTB },    // idsel 30, slot 19
    {  INTD, INTA, INTB, INTC }     // idsel 31, slot 20
} ;
uHALr_printf("pin = %d, slot = %d\n", pin, slot) ;

    if (pin == 0) pin = 1 ; //if PIN = 0, default to A
    return irq_tab[slot-9][pin-1] ; //return the magic number
}
Was this page helpful? Yes No