From b8c9a5141fdf5b238f3e4db513469afed9d02c38 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Tue, 8 Aug 2023 11:01:57 -0400 Subject: [PATCH 1/2] Fix missed bits from pci rewrite in pci_dummy.c --- src/pci_dummy.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pci_dummy.c b/src/pci_dummy.c index 1e49f9f99..87ba39901 100644 --- a/src/pci_dummy.c +++ b/src/pci_dummy.c @@ -17,7 +17,7 @@ typedef struct pci_dummy_t { bar_t pci_bar[2]; - uint8_t card; + uint8_t pci_slot; uint8_t interrupt_on; uint8_t irq_level; @@ -28,9 +28,9 @@ pci_dummy_interrupt(int set, pci_dummy_t *dev) { if (set != dev->irq_level) { if (set) - pci_set_irq(dev->card, PCI_INTA); + pci_set_irq(dev->pci_slot, PCI_INTA, &dev->irq_state); else - pci_clear_irq(dev->card, PCI_INTA); + pci_clear_irq(dev->pci_slot, PCI_INTA, &dev->irq_state); } dev->irq_level = set; @@ -166,8 +166,8 @@ pci_dummy_pci_read(int func, int addr, void *priv) ret = dev->pci_regs[addr]; break; - case 0x08: /* Techncially, revision, but we return the card (slot) here. */ - ret = dev->card; + case 0x08: /* Techncially, revision, but we return the slot here. */ + ret = dev->pci_slot; break; case 0x10: /* PCI_BAR 7:5 */ @@ -242,7 +242,7 @@ pci_dummy_pci_write(int func, int addr, uint8_t val, void *priv) break; case 0x3c: /* PCI_ILR */ - pclog("AB0B:071A Device %02X: IRQ now: %i\n", dev->card, val); + pclog("AB0B:071A Device %02X: IRQ now: %i\n", dev->pci_slot, val); dev->pci_regs[addr] = val; return; @@ -279,7 +279,7 @@ pci_dummy_card_init(UNUSED(const device_t *info)) { pci_dummy_t *dev = (pci_dummy_t *) calloc(1, sizeof(pci_dummy_t)); - dev->card = pci_add_card(PCI_ADD_NORMAL, pci_dummy_pci_read, pci_dummy_pci_write, dev); + pci_add_card(PCI_ADD_NORMAL, pci_dummy_pci_read, pci_dummy_pci_write, dev, &dev->pci_slot); return dev; } From 914e1b92b48d8b309f24582252c07a71cb481f5a Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Tue, 8 Aug 2023 11:16:43 -0400 Subject: [PATCH 2/2] add irq_state --- src/pci_dummy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pci_dummy.c b/src/pci_dummy.c index 87ba39901..3077b59a6 100644 --- a/src/pci_dummy.c +++ b/src/pci_dummy.c @@ -18,6 +18,7 @@ typedef struct pci_dummy_t { bar_t pci_bar[2]; uint8_t pci_slot; + uint8_t irq_state; uint8_t interrupt_on; uint8_t irq_level;