PCI: More fixes to the internal IRQ mechanism.

This commit is contained in:
OBattler
2024-05-24 11:01:58 +02:00
parent 07f71aab05
commit 8ced9eba65
2 changed files with 6 additions and 8 deletions

View File

@@ -110,6 +110,7 @@
#define PCI_CARD_MAX (PCI_CARDS_NUM - 1)
/* The number of PCI card INT pins - always at 4 per the PCI specification. */
#define PCI_INT_PINS_NUM 4
#define PCI_INT_PINS_MAX (PCI_INT_PINS_NUM - 1)
/* The base for MIRQ lines accepted by pci_irq(). */
#define PCI_MIRQ_BASE PCI_CARDS_NUM
/* PCI MIRQ lines (currently 8, this many are needed by the ALi M1543(C). */
@@ -154,7 +155,7 @@
#define pci_set_mirq(mirq, level, irq_state) \
pci_irq(PCI_MIRQ_BASE | (mirq), 0, level, 1, irq_state)
#define pci_set_iirq(pci_int, irq_state) \
pci_irq(PCI_IIRQ_BASE | 0, pci_int, 0, 1, irq_state)
pci_irq(PCI_IIRQ_BASE | (pci_int), 0, 0, 1, irq_state)
#define pci_set_dirq(irq, irq_state) \
pci_irq(PCI_DIRQ_BASE | (irq), 0, 1, 1, irq_state)
#define pci_set_irq(slot, pci_int, irq_state) \
@@ -162,7 +163,7 @@
#define pci_clear_mirq(mirq, level, irq_state) \
pci_irq(PCI_MIRQ_BASE | (mirq), 0, level, 0, irq_state)
#define pci_clear_iirq(pci_int, irq_state) \
pci_irq(PCI_IIRQ_BASE | 0, pci_int, 0, 0, irq_state)
pci_irq(PCI_IIRQ_BASE | (pci_int), 0, 0, 0, irq_state)
#define pci_clear_dirq(dirq, irq_state) \
pci_irq(PCI_DIRQ_BASE | (irq), 0, 1, 0, irq_state)
#define pci_clear_irq(slot, pci_int, irq_state) \

View File

@@ -206,16 +206,13 @@ pci_irq(uint8_t slot, uint8_t pci_int, int level, int set, uint8_t *irq_state)
break;
case (PCI_IIRQ_BASE | 0x00) ... (PCI_IIRQ_BASE | PCI_IIRQ_MAX):
/* PCI internal routing. */
if (!last_pci_card || (pci_flags & FLAG_NO_IRQ_STEERING))
return;
slot = (slot - 1) & PCI_INT_PINS_MAX;
irq_routing = (pci_int_index - PCI_IIRQ_BASE) & PCI_IRQ_MAX;
irq_line = pci_irqs[irq_routing];
irq_line = pci_irqs[slot];
/* Ignore what was provided to us as a parameter and override it with whatever
the chipset is set to. */
level = !!pci_irq_level[irq_routing];
level = !!pci_irq_level[slot];
break;
case (PCI_MIRQ_BASE | 0x00) ... (PCI_MIRQ_BASE | PCI_MIRQ_MAX):
/* MIRQ */