[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 06/11] hw/ide: Replace isa_get_irq() by isa_bus_get_irq()
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH 06/11] hw/ide: Replace isa_get_irq() by isa_bus_get_irq() |
Date: |
Tue, 18 May 2021 23:55:40 +0200 |
Both PIIX/VIA objects inherit PCI_IDE, thus have a pointer to an
ISA bus. Pass this bus argument to isa_bus_get_irq() instead of
calling isa_get_irq() with a NULL device.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
hw/ide/piix.c | 2 +-
hw/ide/via.c | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index 3aef9b1e21c..debbc0023dc 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -139,7 +139,7 @@ static void pci_piix_init_ports(PCIIDEState *d) {
ide_bus_new(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2);
ide_init_ioport(&d->bus[i], NULL, port_info[i].iobase,
port_info[i].iobase2);
- ide_init2(&d->bus[i], isa_get_irq(NULL, port_info[i].isairq));
+ ide_init2(&d->bus[i], isa_bus_get_irq(d->isa_bus,
port_info[i].isairq));
bmdma_init(&d->bus[i], &d->bmdma[i], d);
d->bmdma[i].bus = &d->bus[i];
diff --git a/hw/ide/via.c b/hw/ide/via.c
index 654e15edfed..53545aac474 100644
--- a/hw/ide/via.c
+++ b/hw/ide/via.c
@@ -106,6 +106,7 @@ static void bmdma_setup_bar(PCIIDEState *d)
static void via_ide_set_irq(void *opaque, int n, int level)
{
PCIDevice *d = PCI_DEVICE(opaque);
+ PCIIDEState *id = PCI_IDE(d);
if (level) {
d->config[0x70 + n * 8] |= 0x80;
@@ -113,7 +114,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(isa_bus_get_irq(id->isa_bus, 14 + n), level);
}
static void via_ide_reset(DeviceState *dev)
--
2.26.3
- [RFC PATCH 00/11] hw/isa: Remove dependencies on ISA bus singleton, Philippe Mathieu-Daudé, 2021/05/18
- [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link, Philippe Mathieu-Daudé, 2021/05/18
- [RFC PATCH 03/11] hw/ide/piix: Set the ISA-bus QOM link, Philippe Mathieu-Daudé, 2021/05/18
- [RFC PATCH 01/11] hw/isa: Explode pci_create_simple() calls, Philippe Mathieu-Daudé, 2021/05/18
- [RFC PATCH 04/11] hw/ide/via: Set the ISA-bus QOM link, Philippe Mathieu-Daudé, 2021/05/18
- [RFC PATCH 05/11] hw/isa: Extract isa_bus_get_irq() from isa_get_irq(), Philippe Mathieu-Daudé, 2021/05/18
- [RFC PATCH 06/11] hw/ide: Replace isa_get_irq() by isa_bus_get_irq(),
Philippe Mathieu-Daudé <=
- [RFC PATCH 07/11] hw/isa: Simplify isa_get_irq(), Philippe Mathieu-Daudé, 2021/05/18
- [RFC PATCH 09/11] hw/ide: Let ide_init_ioport() take an ISA bus argument instead of device, Philippe Mathieu-Daudé, 2021/05/18
- [RFC PATCH 08/11] hw/isa: Extract bus part from isa_register_portio_list(), Philippe Mathieu-Daudé, 2021/05/18
- [RFC PATCH 10/11] hw/isa: Remove use of global isa bus, Philippe Mathieu-Daudé, 2021/05/18
- [RFC PATCH 11/11] hw/isa: Rename isabus singleton as 'g_isabus', Philippe Mathieu-Daudé, 2021/05/18