[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 11/11] hw/isa: Rename isabus singleton as 'g_isabus'
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH 11/11] hw/isa: Rename isabus singleton as 'g_isabus' |
Date: |
Tue, 18 May 2021 23:55:45 +0200 |
To make explicit the isabus singleton isn't used anywhere else,
move it's static declaration locally to isa_bus_new() and rename
it as 'g_isabus'.
Unfortunately we provide the get_system_io() call which expose
an unique I/O bus to a machine, and the ISA bus rely on this I/O
bus, so we can not remove the ISA bus singleton until we remove
the get_system_io() API.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
hw/isa/isa-bus.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
index a19e3688c28..422eb9615f4 100644
--- a/hw/isa/isa-bus.c
+++ b/hw/isa/isa-bus.c
@@ -26,8 +26,6 @@
#include "sysemu/sysemu.h"
#include "hw/isa/isa.h"
-static ISABus *isabus;
-
static void isabus_dev_print(Monitor *mon, DeviceState *dev, int indent);
static char *isabus_get_fw_dev_path(DeviceState *dev);
@@ -55,7 +53,10 @@ static const TypeInfo isa_bus_info = {
ISABus *isa_bus_new(DeviceState *dev, MemoryRegion* address_space,
MemoryRegion *address_space_io, Error **errp)
{
- if (isabus) {
+ static ISABus *g_isabus;
+ ISABus *isabus;
+
+ if (g_isabus) {
error_setg(errp, "Can't create a second ISA bus");
return NULL;
}
@@ -67,6 +68,7 @@ ISABus *isa_bus_new(DeviceState *dev, MemoryRegion*
address_space,
isabus = ISA_BUS(qbus_create(TYPE_ISA_BUS, dev, NULL));
isabus->address_space = address_space;
isabus->address_space_io = address_space_io;
+ g_isabus = isabus;
return isabus;
}
--
2.26.3
- [RFC PATCH 01/11] hw/isa: Explode pci_create_simple() calls, (continued)
- [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é, 2021/05/18
- [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é <=