提交 a4dec1d0 编写于 作者: J Juan Quintela 提交者: Anthony Liguori

vmstate: port stellaris ssi bus

Signed-off-by: NJuan Quintela <quintela@redhat.com>
上级 ff269cd0
...@@ -1218,24 +1218,16 @@ static uint32_t stellaris_ssi_bus_transfer(SSISlave *dev, uint32_t val) ...@@ -1218,24 +1218,16 @@ static uint32_t stellaris_ssi_bus_transfer(SSISlave *dev, uint32_t val)
return ssi_transfer(s->bus[s->current_dev], val); return ssi_transfer(s->bus[s->current_dev], val);
} }
static void stellaris_ssi_bus_save(QEMUFile *f, void *opaque) static const VMStateDescription vmstate_stellaris_ssi_bus = {
{ .name = "stellaris_ssi_bus",
stellaris_ssi_bus_state *s = (stellaris_ssi_bus_state *)opaque; .version_id = 1,
.minimum_version_id = 1,
qemu_put_be32(f, s->current_dev); .minimum_version_id_old = 1,
} .fields = (VMStateField[]) {
VMSTATE_INT32(current_dev, stellaris_ssi_bus_state),
static int stellaris_ssi_bus_load(QEMUFile *f, void *opaque, int version_id) VMSTATE_END_OF_LIST()
{ }
stellaris_ssi_bus_state *s = (stellaris_ssi_bus_state *)opaque; };
if (version_id != 1)
return -EINVAL;
s->current_dev = qemu_get_be32(f);
return 0;
}
static int stellaris_ssi_bus_init(SSISlave *dev) static int stellaris_ssi_bus_init(SSISlave *dev)
{ {
...@@ -1245,8 +1237,7 @@ static int stellaris_ssi_bus_init(SSISlave *dev) ...@@ -1245,8 +1237,7 @@ static int stellaris_ssi_bus_init(SSISlave *dev)
s->bus[1] = ssi_create_bus(&dev->qdev, "ssi1"); s->bus[1] = ssi_create_bus(&dev->qdev, "ssi1");
qdev_init_gpio_in(&dev->qdev, stellaris_ssi_bus_select, 1); qdev_init_gpio_in(&dev->qdev, stellaris_ssi_bus_select, 1);
register_savevm(&dev->qdev, "stellaris_ssi_bus", -1, 1, vmstate_register(&dev->qdev, -1, &vmstate_stellaris_ssi_bus, s);
stellaris_ssi_bus_save, stellaris_ssi_bus_load, s);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册