aboutsummaryrefslogtreecommitdiff
path: root/hw/ssi.h
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-12-16 13:36:39 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-01-27 10:50:47 -0600
commitcd6c4cf28b529aaee0367256d37f349e3b125818 (patch)
treea13e1eee93c85362ef4ce4c33cc3608412c64f7a /hw/ssi.h
parentba7c05205c4ba2fd08096b0083fc1e5decf3c342 (diff)
downloadqemu-cd6c4cf28b529aaee0367256d37f349e3b125818.zip
qemu-cd6c4cf28b529aaee0367256d37f349e3b125818.tar.gz
qemu-cd6c4cf28b529aaee0367256d37f349e3b125818.tar.bz2
ssi: convert to QEMU Object Model
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/ssi.h')
-rw-r--r--hw/ssi.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/hw/ssi.h b/hw/ssi.h
index 24610a8..97aefa7 100644
--- a/hw/ssi.h
+++ b/hw/ssi.h
@@ -15,22 +15,30 @@
typedef struct SSISlave SSISlave;
+#define TYPE_SSI_SLAVE "ssi-slave"
+#define SSI_SLAVE(obj) \
+ OBJECT_CHECK(SSISlave, (obj), TYPE_SSI_SLAVE)
+#define SSI_SLAVE_CLASS(klass) \
+ OBJECT_CLASS_CHECK(SSISlaveClass, (klass), TYPE_SSI_SLAVE)
+#define SSI_SLAVE_GET_CLASS(obj) \
+ OBJECT_GET_CLASS(SSISlaveClass, (obj), TYPE_SSI_SLAVE)
+
/* Slave devices. */
-typedef struct {
- DeviceInfo qdev;
+typedef struct SSISlaveClass {
+ DeviceClass parent_class;
+
int (*init)(SSISlave *dev);
uint32_t (*transfer)(SSISlave *dev, uint32_t val);
-} SSISlaveInfo;
+} SSISlaveClass;
struct SSISlave {
DeviceState qdev;
- SSISlaveInfo *info;
};
#define SSI_SLAVE_FROM_QDEV(dev) DO_UPCAST(SSISlave, qdev, dev)
#define FROM_SSI_SLAVE(type, dev) DO_UPCAST(type, ssidev, dev)
-void ssi_register_slave(SSISlaveInfo *info);
+void ssi_register_slave(DeviceInfo *info);
DeviceState *ssi_create_slave(SSIBus *bus, const char *name);