[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 02/20] hw/pci-host/q35: Inline sysbus_add_io()
From: |
Bernhard Beschow |
Subject: |
[PATCH v2 02/20] hw/pci-host/q35: Inline sysbus_add_io() |
Date: |
Tue, 31 Jan 2023 12:53:08 +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->mch.address_space_io which is set as an alias to
get_system_io() by the q35 machine.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
hw/pci-host/q35.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index 26390863d6..fa05844319 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -50,10 +50,12 @@ static void q35_host_realize(DeviceState *dev, Error **errp)
Q35PCIHost *s = Q35_HOST_DEVICE(dev);
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
- sysbus_add_io(sbd, MCH_HOST_BRIDGE_CONFIG_ADDR, &pci->conf_mem);
+ memory_region_add_subregion(s->mch.address_space_io,
+ MCH_HOST_BRIDGE_CONFIG_ADDR, &pci->conf_mem);
sysbus_init_ioports(sbd, MCH_HOST_BRIDGE_CONFIG_ADDR, 4);
- sysbus_add_io(sbd, MCH_HOST_BRIDGE_CONFIG_DATA, &pci->data_mem);
+ memory_region_add_subregion(s->mch.address_space_io,
+ MCH_HOST_BRIDGE_CONFIG_DATA, &pci->data_mem);
sysbus_init_ioports(sbd, MCH_HOST_BRIDGE_CONFIG_DATA, 4);
/* register q35 0xcf8 port as coalesced pio */
--
2.39.1
- [PATCH v2 00/20] PC and ICH9 cleanups, Bernhard Beschow, 2023/01/31
- [PATCH v2 01/20] hw/pci-host/i440fx: Inline sysbus_add_io(), Bernhard Beschow, 2023/01/31
- [PATCH v2 03/20] hw/i386/pc_q35: Reuse machine parameter, Bernhard Beschow, 2023/01/31
- [PATCH v2 02/20] hw/pci-host/q35: Inline sysbus_add_io(),
Bernhard Beschow <=
- [PATCH v2 05/20] hw/i386/pc_{q35, piix}: Reuse MachineClass::desc as SMB product name, Bernhard Beschow, 2023/01/31
- [PATCH v2 06/20] hw/i386/pc_{q35, piix}: Minimize usage of get_system_memory(), Bernhard Beschow, 2023/01/31
- [PATCH v2 04/20] hw/i386/pc_q35: Resolve redundant q35_host variable, Bernhard Beschow, 2023/01/31
- [PATCH v2 07/20] hw/i386/pc: Initialize ram_memory variable directly, Bernhard Beschow, 2023/01/31
- [PATCH v2 08/20] hw/i386/ich9: Rename Q35_MASK to ICH9_MASK, Bernhard Beschow, 2023/01/31