aboutsummaryrefslogtreecommitdiff
path: root/hw/syborg_timer.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/syborg_timer.c
parentfd93a79999c728dd1f30bb2e726ce12bdf704e6d (diff)
downloadqemu-1431b6a17e6546569e09bcf8fb7773c925658d8f.zip
qemu-1431b6a17e6546569e09bcf8fb7773c925658d8f.tar.gz
qemu-1431b6a17e6546569e09bcf8fb7773c925658d8f.tar.bz2
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/syborg_timer.c')
-rw-r--r--hw/syborg_timer.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/hw/syborg_timer.c b/hw/syborg_timer.c
index a84ad86..b833330 100644
--- a/hw/syborg_timer.c
+++ b/hw/syborg_timer.c
@@ -226,10 +226,20 @@ static void syborg_timer_init(SysBusDevice *dev)
syborg_timer_save, syborg_timer_load, s);
}
+static SysBusDeviceInfo syborg_timer_info = {
+ .init = syborg_timer_init,
+ .qdev = {
+ .props = (DevicePropList[]) {
+ {.name = "frequency", .type = PROP_TYPE_INT},
+ {.name = NULL}
+ }
+ }
+};
+
static void syborg_timer_register_devices(void)
{
- sysbus_register_dev("syborg,timer", sizeof(SyborgTimerState),
- syborg_timer_init);
+ sysbus_register_withprop("syborg,timer", sizeof(SyborgTimerState),
+ &syborg_timer_info);
}
device_init(syborg_timer_register_devices)