qemu-ppc
[Top][All Lists]
Advanced

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

Re: [PATCH v2 08/10] hw/ide: Let ide_init_ioport() take a MemoryRegion a


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v2 08/10] hw/ide: Let ide_init_ioport() take a MemoryRegion argument instead of ISADevice
Date: Fri, 27 Jan 2023 01:27:03 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1

On 26/1/23 22:17, Bernhard Beschow wrote:
Both callers to ide_init_ioport() have access to the I/O memory region
of the ISA bus, so can pass it directly. This allows ide_init_ioport()
to directly call portio_list_init().

Note, now the callers become the owner of the PortioList.

Inspired-by: <20210518215545.1793947-10-philmd@redhat.com>
   'hw/ide: Let ide_init_ioport() take an ISA bus argument instead of device'
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
  include/hw/ide/internal.h |  3 ++-
  hw/ide/ioport.c           | 15 ++++++++-------
  hw/ide/isa.c              |  4 +++-
  hw/ide/piix.c             |  8 ++++++--
  4 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h
index 42c49414f4..c3e4d192fa 100644
--- a/include/hw/ide/internal.h
+++ b/include/hw/ide/internal.h
@@ -628,7 +628,8 @@ int ide_init_drive(IDEState *s, BlockBackend *blk, 
IDEDriveKind kind,
                     int chs_trans, Error **errp);
  void ide_init2(IDEBus *bus, qemu_irq irq);
  void ide_exit(IDEState *s);
-void ide_init_ioport(IDEBus *bus, ISADevice *isa, int iobase, int iobase2);
+void ide_init_ioport(IDEBus *bus, MemoryRegion *address_space_io, Object 
*owner,
+                     int iobase, int iobase2);
  void ide_register_restart_cb(IDEBus *bus);
void ide_exec_cmd(IDEBus *bus, uint32_t val);
diff --git a/hw/ide/ioport.c b/hw/ide/ioport.c
index b613ff3bba..00e9baf0d1 100644
--- a/hw/ide/ioport.c
+++ b/hw/ide/ioport.c
@@ -50,15 +50,16 @@ static const MemoryRegionPortio ide_portio2_list[] = {
      PORTIO_END_OF_LIST(),
  };
-void ide_init_ioport(IDEBus *bus, ISADevice *dev, int iobase, int iobase2)
+void ide_init_ioport(IDEBus *bus, MemoryRegion *address_space_io, Object 
*owner,
+                     int iobase, int iobase2)
  {

Eh I have almost the same change locally :)

$ git diff d2968dc5d0940799~..629b479f0b8f082688
diff --git a/hw/ide/ioport.c b/hw/ide/ioport.c
index fcfaa00cb9..f82e00076a 100644
--- a/hw/ide/ioport.c
+++ b/hw/ide/ioport.c
@@ -50,20 +50,21 @@ static const MemoryRegionPortio ide_portio2_list[] = {
     PORTIO_END_OF_LIST(),
 };

-int ide_init_ioport(IDEBus *bus, ISADevice *dev, int iobase, int iobase2)
+int ide_init_ioport(IDEBus *bus, Object *owner, ISADevice *dev,
+                    MemoryRegion *isa_io, int iobase, int iobase2)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>





reply via email to

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