[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/7] hw/ide: Introduce generic ide_init_ioport()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 4/7] hw/ide: Introduce generic ide_init_ioport() |
Date: |
Wed, 8 Feb 2023 01:07:40 +0100 |
Add ide_init_ioport() which is not restricted to the ISA bus.
(Next commit will use it for a PCI device).
Inspired-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/ide/ioport.c | 11 +++++++++--
include/hw/ide/internal.h | 2 ++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/hw/ide/ioport.c b/hw/ide/ioport.c
index ac804a89e8..494fa88368 100644
--- a/hw/ide/ioport.c
+++ b/hw/ide/ioport.c
@@ -54,8 +54,6 @@ int ide_init_ioport_isa(IDEBus *bus, ISADevice *dev, int
iobase, int iobase2)
{
int ret;
- /* ??? Assume only ISA and PCI configurations, and that the PCI-ISA
- bridge has been setup properly to always register with ISA. */
ret = isa_register_portio_list(dev, &bus->portio_list,
iobase, ide_portio_list, bus, "ide");
@@ -66,3 +64,12 @@ int ide_init_ioport_isa(IDEBus *bus, ISADevice *dev, int
iobase, int iobase2)
return ret;
}
+
+void ide_init_ioport(IDEBus *bus, Object *owner, MemoryRegion *io,
+ int iobase, int iobase2)
+{
+ portio_list_register(&bus->portio_list, owner, ide_portio_list,
+ bus, "ide", io, iobase);
+ portio_list_register(&bus->portio2_list, owner, ide_portio2_list,
+ bus, "ide", io, iobase2);
+}
diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h
index 88a096f9df..79db902505 100644
--- a/include/hw/ide/internal.h
+++ b/include/hw/ide/internal.h
@@ -629,6 +629,8 @@ int ide_init_drive(IDEState *s, BlockBackend *blk,
IDEDriveKind kind,
void ide_init2(IDEBus *bus, qemu_irq irq);
void ide_exit(IDEState *s);
int ide_init_ioport_isa(IDEBus *bus, ISADevice *isa, int iobase, int iobase2);
+void ide_init_ioport(IDEBus *bus, Object *owner, MemoryRegion *io,
+ int iobase, int iobase2);
void ide_register_restart_cb(IDEBus *bus);
void ide_exec_cmd(IDEBus *bus, uint32_t val);
--
2.38.1
- [PATCH 6/7] hw/isa: Assert isa_register_portio_list() gets non-NULL ISA device, (continued)
[PATCH 5/7] hw/ide/piix: Use generic ide_init_ioport(), Philippe Mathieu-Daudé, 2023/02/07
[PATCH 4/7] hw/ide: Introduce generic ide_init_ioport(),
Philippe Mathieu-Daudé <=
[PATCH 7/7] hw/ide/piix: Remove dead code in pci_piix_init_ports(), Philippe Mathieu-Daudé, 2023/02/07
Re: [PATCH 0/7] hw/ide: Untangle ISA/PCI abuses of ide_init_ioport(), Philippe Mathieu-Daudé, 2023/02/07