[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 1/9] hw/pci-host/i440fx: Inline sysbus_add_io()
From: |
Bernhard Beschow |
Subject: |
[PATCH v3 1/9] hw/pci-host/i440fx: Inline sysbus_add_io() |
Date: |
Sat, 4 Feb 2023 16:10:19 +0100 |
sysbus_add_io() just wraps memory_region_add_subregion() while also
obscuring where the memory is attached. So use
memory_region_add_subregion() directly and attach it to the existing
memory region s->bus->address_space_io which is set as an alias to
get_system_io() by the pc machine.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
---
hw/pci-host/i440fx.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c
index 262f82c303..9c6882d3fc 100644
--- a/hw/pci-host/i440fx.c
+++ b/hw/pci-host/i440fx.c
@@ -27,6 +27,7 @@
#include "qemu/range.h"
#include "hw/i386/pc.h"
#include "hw/pci/pci.h"
+#include "hw/pci/pci_bus.h"
#include "hw/pci/pci_host.h"
#include "hw/pci-host/i440fx.h"
#include "hw/qdev-properties.h"
@@ -217,10 +218,10 @@ static void i440fx_pcihost_realize(DeviceState *dev,
Error **errp)
PCIHostState *s = PCI_HOST_BRIDGE(dev);
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
- sysbus_add_io(sbd, 0xcf8, &s->conf_mem);
+ memory_region_add_subregion(s->bus->address_space_io, 0xcf8, &s->conf_mem);
sysbus_init_ioports(sbd, 0xcf8, 4);
- sysbus_add_io(sbd, 0xcfc, &s->data_mem);
+ memory_region_add_subregion(s->bus->address_space_io, 0xcfc, &s->data_mem);
sysbus_init_ioports(sbd, 0xcfc, 4);
/* register i440fx 0xcf8 port as coalesced pio */
--
2.39.1
- [PATCH v3 0/9] PC cleanups, Bernhard Beschow, 2023/02/04
- [PATCH v3 1/9] hw/pci-host/i440fx: Inline sysbus_add_io(),
Bernhard Beschow <=
- [PATCH v3 2/9] hw/pci-host/q35: Inline sysbus_add_io(), Bernhard Beschow, 2023/02/04
- [PATCH v3 3/9] hw/i386/pc_q35: Reuse machine parameter, Bernhard Beschow, 2023/02/04
- [PATCH v3 4/9] hw/i386/pc_{q35, piix}: Reuse MachineClass::desc as SMB product name, Bernhard Beschow, 2023/02/04
- [PATCH v3 5/9] hw/i386/pc_{q35, piix}: Minimize usage of get_system_memory(), Bernhard Beschow, 2023/02/04
- [PATCH v3 6/9] hw/i386/pc: Initialize ram_memory variable directly, Bernhard Beschow, 2023/02/04