PCI: Add mechanism for internally wired IRQ routings.

This commit is contained in:
OBattler
2024-05-24 10:14:41 +02:00
parent 0a9d71a42b
commit 5ff67132a6
2 changed files with 22 additions and 0 deletions

View File

@@ -115,6 +115,11 @@
/* PCI MIRQ lines (currently 8, this many are needed by the ALi M1543(C). */
#define PCI_MIRQS_NUM 8
#define PCI_MIRQ_MAX (PCI_MIRQS_NUM - 1)
/* The base for internal IRQ lines accepted by pci_irq(). */
#define PCI_IIRQ_BASE 0x80
/* PCI direct IRQ lines - always at 4 per the PCI specification. */
#define PCI_IIRQS_NUM 4
#define PCI_IIRQ_MAX (PCI_IIRQS_NUM - 1)
/* The base for direct IRQ lines accepted by pci_irq(). */
#define PCI_DIRQ_BASE 0xf0
/* PCI direct IRQ lines (currently 16 because we only emulate the legacy PIC). */
@@ -148,12 +153,16 @@
#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)
#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) \
pci_irq(slot, pci_int, 0, 1, irq_state)
#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)
#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) \