[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 7/9] hw/sysbus: Introduce dedicated struct SysBusState for TYPE_SYSTEM_BUS
- To: qemu-devel@xxxxxxxxxx
- From: Bernhard Beschow <shentey@xxxxxxxxx>
- Date: Tue, 20 Sep 2022 01:17:18 +0200
- Cc: "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Magnus Damm <magnus.damm@xxxxxxxxx>, Aleksandar Rikalo <aleksandar.rikalo@xxxxxxxxxx>, Bandan Das <bsd@xxxxxxxxxx>, Matthew Rosato <mjrosato@xxxxxxxxxxxxx>, Daniel Henrique Barboza <danielhb413@xxxxxxxxx>, Sergio Lopez <slp@xxxxxxxxxx>, Alexey Kardashevskiy <aik@xxxxxxxxx>, Xiaojuan Yang <yangxiaojuan@xxxxxxxxxxx>, Cameron Esfahani <dirty@xxxxxxxxx>, Michael Rolnik <mrolnik@xxxxxxxxx>, Song Gao <gaosong@xxxxxxxxxxx>, Jagannathan Raman <jag.raman@xxxxxxxxxx>, Greg Kurz <groug@xxxxxxxx>, Kamil Rytarowski <kamil@xxxxxxxxxx>, Peter Xu <peterx@xxxxxxxxxx>, Joel Stanley <joel@xxxxxxxxx>, Alistair Francis <Alistair.Francis@xxxxxxx>, "Dr. David Alan Gilbert" <dgilbert@xxxxxxxxxx>, Paolo Bonzini <pbonzini@xxxxxxxxxx>, haxm-team@xxxxxxxxx, Roman Bolshakov <r.bolshakov@xxxxxxxxx>, Markus Armbruster <armbru@xxxxxxxxxx>, Eric Auger <eric.auger@xxxxxxxxxx>, David Gibson <david@xxxxxxxxxxxxxxxxxxxxx>, Daniel P. Berrangé <berrange@xxxxxxxxxx>, Christian Borntraeger <borntraeger@xxxxxxxxxxxxx>, Cédric Le Goater <clg@xxxxxxxx>, Stefan Hajnoczi <stefanha@xxxxxxxxxx>, qemu-block@xxxxxxxxxx, Eduardo Habkost <eduardo@xxxxxxxxxxx>, Hervé Poussineau <hpoussin@xxxxxxxxxxx>, qemu-ppc@xxxxxxxxxx, Cornelia Huck <cohuck@xxxxxxxxxx>, Palmer Dabbelt <palmer@xxxxxxxxxxx>, Helge Deller <deller@xxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Philippe Mathieu-Daudé <f4bug@xxxxxxxxx>, qemu-riscv@xxxxxxxxxx, Stafford Horne <shorne@xxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Havard Skinnemoen <hskinnemoen@xxxxxxxxxx>, Elena Ufimtseva <elena.ufimtseva@xxxxxxxxxx>, Alexander Graf <agraf@xxxxxxxxx>, Thomas Huth <thuth@xxxxxxxxxx>, Alex Williamson <alex.williamson@xxxxxxxxxx>, Wenchao Wang <wenchao.wang@xxxxxxxxx>, Tony Krowiak <akrowiak@xxxxxxxxxxxxx>, Marcel Apfelbaum <marcel.apfelbaum@xxxxxxxxx>, qemu-s390x@xxxxxxxxxx, Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>, Mark Cave-Ayland <mark.cave-ayland@xxxxxxxxxxxx>, Eric Farman <farman@xxxxxxxxxxxxx>, Reinoud Zandijk <reinoud@xxxxxxxxxx>, Alexander Bulekov <alxndr@xxxxxx>, Yanan Wang <wangyanan55@xxxxxxxxxx>, "Edgar E. Iglesias" <edgar.iglesias@xxxxxxxxx>, Gerd Hoffmann <kraxel@xxxxxxxxxx>, Tyrone Ting <kfting@xxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>, John Snow <jsnow@xxxxxxxxxx>, Richard Henderson <richard.henderson@xxxxxxxxxx>, Darren Kenny <darren.kenny@xxxxxxxxxx>, kvm@xxxxxxxxxxxxxxx, Qiuhao Li <Qiuhao.Li@xxxxxxxxxxx>, John G Johnson <john.g.johnson@xxxxxxxxxx>, Bin Meng <bin.meng@xxxxxxxxxxxxx>, Sunil Muthuswamy <sunilmut@xxxxxxxxxxxxx>, Max Filippov <jcmvbkbc@xxxxxxxxx>, qemu-arm@xxxxxxxxxx, Marcelo Tosatti <mtosatti@xxxxxxxxxx>, Peter Maydell <peter.maydell@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Andrew Jeffery <andrew@xxxxxxxx>, Artyom Tarasenko <atar4qemu@xxxxxxxxx>, Halil Pasic <pasic@xxxxxxxxxxxxx>, "Maciej S. Szmigiero" <maciej.szmigiero@xxxxxxxxxx>, Jason Wang <jasowang@xxxxxxxxxx>, David Hildenbrand <david@xxxxxxxxxx>, Laurent Vivier <laurent@xxxxxxxxx>, Alistair Francis <alistair@xxxxxxxxxxxxx>, Jason Herne <jjherne@xxxxxxxxxxxxx>, Bernhard Beschow <shentey@xxxxxxxxx>
- Delivery-date: Mon, 19 Sep 2022 23:19:02 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
With this out of the way, in the next step, SysBusState gains attributes
for its memory and address recouces.
Signed-off-by: Bernhard Beschow <shentey@xxxxxxxxx>
---
hw/core/sysbus.c | 4 ++--
include/hw/boards.h | 3 ++-
include/hw/misc/macio/macio.h | 2 +-
include/hw/sysbus.h | 8 ++++++--
4 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c
index 16a9b4d7a0..1100f3ad6c 100644
--- a/hw/core/sysbus.c
+++ b/hw/core/sysbus.c
@@ -84,7 +84,7 @@ static void system_bus_class_init(ObjectClass *klass, void
*data)
static const TypeInfo system_bus_info = {
.name = TYPE_SYSTEM_BUS,
.parent = TYPE_BUS,
- .instance_size = sizeof(BusState),
+ .instance_size = sizeof(SysBusState),
.class_init = system_bus_class_init,
};
@@ -343,7 +343,7 @@ BusState *sysbus_get_default(void)
return NULL;
}
- return ¤t_machine->main_system_bus;
+ return ¤t_machine->main_system_bus.parent_obj;
}
static void sysbus_register_types(void)
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 7af940102d..63a4f990ea 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -11,6 +11,7 @@
#include "qemu/module.h"
#include "qom/object.h"
#include "hw/core/cpu.h"
+#include "hw/sysbus.h"
#define TYPE_MACHINE_SUFFIX "-machine"
@@ -346,7 +347,7 @@ struct MachineState {
*/
MemoryRegion *ram;
DeviceMemoryState *device_memory;
- BusState main_system_bus;
+ SysBusState main_system_bus;
ram_addr_t ram_size;
ram_addr_t maxram_size;
diff --git a/include/hw/misc/macio/macio.h b/include/hw/misc/macio/macio.h
index 6c05f3bfd2..0944be587f 100644
--- a/include/hw/misc/macio/macio.h
+++ b/include/hw/misc/macio/macio.h
@@ -44,7 +44,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(MacIOBusState, MACIO_BUS)
struct MacIOBusState {
/*< private >*/
- BusState parent_obj;
+ SysBusState parent_obj;
};
/* MacIO IDE */
diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h
index 3564b7b6a2..5bb3b88501 100644
--- a/include/hw/sysbus.h
+++ b/include/hw/sysbus.h
@@ -11,9 +11,13 @@
#define QDEV_MAX_PIO 32
#define TYPE_SYSTEM_BUS "System"
-DECLARE_INSTANCE_CHECKER(BusState, SYSTEM_BUS,
- TYPE_SYSTEM_BUS)
+OBJECT_DECLARE_SIMPLE_TYPE(SysBusState, SYSTEM_BUS)
+struct SysBusState {
+ /*< private >*/
+ BusState parent_obj;
+ /*< public >*/
+};
#define TYPE_SYS_BUS_DEVICE "sys-bus-device"
OBJECT_DECLARE_TYPE(SysBusDevice, SysBusDeviceClass,
--
2.37.3
|