[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 08/11] hw/isa: Extract bus part from isa_register_portio_list
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH 08/11] hw/isa: Extract bus part from isa_register_portio_list() |
Date: |
Tue, 18 May 2021 23:55:42 +0200 |
isa_register_portio_list() takes an ISADevice argument mostly
to resolve the ISA bus. Extract the bus logic to a new function:
isa_bus_register_portio_list().
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
include/hw/isa/isa.h | 4 ++++
hw/isa/isa-bus.c | 17 +++++++++++++----
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index fd8b84d8007..ce31eef8858 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -139,6 +139,10 @@ void isa_register_portio_list(ISADevice *dev,
uint16_t start,
const MemoryRegionPortio *portio,
void *opaque, const char *name);
+void isa_bus_register_portio_list(ISABus *isabus, Object *owner,
+ PortioList *piolist, uint16_t start,
+ const MemoryRegionPortio *portio,
+ void *opaque, const char *name);
static inline ISABus *isa_bus_from_device(ISADevice *d)
{
diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
index 65a26ac6c2c..c79d7e338b0 100644
--- a/hw/isa/isa-bus.c
+++ b/hw/isa/isa-bus.c
@@ -140,20 +140,29 @@ void isa_register_ioport(ISADevice *dev, MemoryRegion
*io, uint16_t start)
isa_init_ioport(dev, start);
}
+void isa_bus_register_portio_list(ISABus *isabus, Object *owner,
+ PortioList *piolist, uint16_t start,
+ const MemoryRegionPortio *portio,
+ void *opaque, const char *name)
+{
+ assert(piolist && !piolist->owner);
+
+ portio_list_init(piolist, owner, portio, opaque, name);
+ portio_list_add(piolist, isabus->address_space_io, start);
+}
+
void isa_register_portio_list(ISADevice *dev,
PortioList *piolist, uint16_t start,
const MemoryRegionPortio *pio_start,
void *opaque, const char *name)
{
- assert(piolist && !piolist->owner);
-
/* START is how we should treat DEV, regardless of the actual
contents of the portio array. This is how the old code
actually handled e.g. the FDC device. */
isa_init_ioport(dev, start);
- portio_list_init(piolist, OBJECT(dev), pio_start, opaque, name);
- portio_list_add(piolist, isabus->address_space_io, start);
+ isa_bus_register_portio_list(isabus, OBJECT(dev), piolist, start,
+ pio_start, opaque, name);
}
static void isa_device_init(Object *obj)
--
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é, 2021/05/18
- [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é <=
- [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