qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 5/6] hw/ide/via: Connect IDE function output IRQs to the ISA


From: Richard Henderson
Subject: Re: [PATCH 5/6] hw/ide/via: Connect IDE function output IRQs to the ISA function input
Date: Thu, 25 Mar 2021 06:29:08 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

On 3/24/21 11:54 AM, Philippe Mathieu-Daudé wrote:
To avoid abusing isa_get_irq(NULL) using a hidden ISA bridge
under the hood, let the IDE function expose 2 output IRQs,
and connect them to the ISA function inputs when creating
the south bridge chipset model in vt82c686b_southbridge_init.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
  hw/ide/via.c        | 19 +++++++++++++++++--
  hw/mips/fuloong2e.c |  9 ++++++++-
  2 files changed, 25 insertions(+), 3 deletions(-)



@@ -112,7 +124,7 @@ static void via_ide_set_irq(void *opaque, int n, int level)
          d->config[0x70 + n * 8] &= ~0x80;
      }
- qemu_set_irq(isa_get_irq(NULL, 14 + n), level);
+    qemu_set_irq(s->irq[n], level);
  }
static void via_ide_reset(DeviceState *dev)
...
diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c
index 931385c760f..f1c5db13b78 100644
--- a/hw/mips/fuloong2e.c
+++ b/hw/mips/fuloong2e.c
@@ -203,12 +203,19 @@ static void vt82c686b_southbridge_init(PCIBus *pci_bus, 
int slot, qemu_irq intc,
                                         I2CBus **i2c_bus)
  {
      PCIDevice *dev;
+    DeviceState *isa;
dev = pci_create_simple_multifunction(pci_bus, PCI_DEVFN(slot, 0), true,
                                            TYPE_VT82C686B_ISA);
-    qdev_connect_gpio_out_named(DEVICE(dev), "intr", 0, intc);
+    isa = DEVICE(dev);
+    qdev_connect_gpio_out_named(isa, "intr", 0, intc);
dev = pci_create_simple(pci_bus, PCI_DEVFN(slot, 1), "via-ide");
+    for (unsigned i = 0; i < 2; i++) {
+        qdev_connect_gpio_out_named(DEVICE(dev), "ide-irq", i,

                                       ^^^^^^^^^^^ isa?

+                                    qdev_get_gpio_in_named(isa,
+                                                           "isa-irq", 14 + i));
+    }

It all looks a little funny, but I think I follow it, and see that it can't be split further, because of the movement of the +14.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~




reply via email to

[Prev in Thread] Current Thread [Next in Thread]