aboutsummaryrefslogtreecommitdiff
path: root/hw/sysbus.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/sysbus.c')
-rw-r--r--hw/sysbus.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/hw/sysbus.c b/hw/sysbus.c
index 13d81f541f..a1843088e3 100644
--- a/hw/sysbus.c
+++ b/hw/sysbus.c
@@ -21,11 +21,6 @@
#include "sysbus.h"
#include "sysemu.h"
-typedef struct {
- DeviceInfo qdev;
- sysbus_initfn init;
-} SysBusDeviceInfo;
-
void sysbus_connect_irq(SysBusDevice *dev, int n, qemu_irq irq)
{
assert(n >= 0 && n < dev->num_irq);
@@ -109,12 +104,9 @@ static void sysbus_device_init(DeviceState *dev, DeviceInfo *base)
info->init(sysbus_from_qdev(dev));
}
-void sysbus_register_dev(const char *name, size_t size, sysbus_initfn init)
+void sysbus_register_withprop(const char *name, size_t size,
+ SysBusDeviceInfo *info)
{
- SysBusDeviceInfo *info;
-
- info = qemu_mallocz(sizeof(*info));
- info->init = init;
info->qdev.init = sysbus_device_init;
info->qdev.bus_type = BUS_TYPE_SYSTEM;
@@ -122,6 +114,15 @@ void sysbus_register_dev(const char *name, size_t size, sysbus_initfn init)
qdev_register(name, size, &info->qdev);
}
+void sysbus_register_dev(const char *name, size_t size, sysbus_initfn init)
+{
+ SysBusDeviceInfo *info;
+
+ info = qemu_mallocz(sizeof(*info));
+ info->init = init;
+ sysbus_register_withprop(name, size, info);
+}
+
DeviceState *sysbus_create_varargs(const char *name,
target_phys_addr_t addr, ...)
{