aboutsummaryrefslogtreecommitdiff
path: root/hw/sysbus.c
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2009-06-05 15:52:04 +0100
committerPaul Brook <paul@codesourcery.com>2009-06-05 15:52:04 +0100
commit1431b6a17e6546569e09bcf8fb7773c925658d8f (patch)
tree83669665d82278a27b12d34d2fc1847944e784de /hw/sysbus.c
parentfd93a79999c728dd1f30bb2e726ce12bdf704e6d (diff)
Record device property types
Record device property types, and provide a list of properties at device registration time. Add a "device" property type that holds a reference to annother device. Signed-off-by: Paul Brook <paul@codesourcery.com>
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, ...)
{