diff options
author | Jan Kiszka <jan.kiszka@web.de> | 2009-09-18 20:51:23 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-10-05 09:32:44 -0500 |
commit | d5b61ddd6587cea493bb6e53e5420d0e76081404 (patch) | |
tree | 5b83d68d4f6e4ac280fb88b6605bfd17175ae44f /hw/marvell_88w8618_audio.c | |
parent | c88d6bded69804617f412a60c7375cc93f8687a5 (diff) |
musicpal: Add VMState support
Register all relevant fields of Musicpal device states with the VMState
framework. This involves a few type changes of state variables.
Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/marvell_88w8618_audio.c')
-rw-r--r-- | hw/marvell_88w8618_audio.c | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/hw/marvell_88w8618_audio.c b/hw/marvell_88w8618_audio.c index 7f17a9f1fc..57c3d5a61b 100644 --- a/hw/marvell_88w8618_audio.c +++ b/hw/marvell_88w8618_audio.c @@ -41,11 +41,11 @@ typedef struct mv88w8618_audio_state { uint32_t playback_mode; uint32_t status; uint32_t irq_enable; - unsigned long phys_buf; + uint32_t phys_buf; uint32_t target_buffer; - unsigned int threshold; - unsigned int play_pos; - unsigned int last_free; + uint32_t threshold; + uint32_t play_pos; + uint32_t last_free; uint32_t clock_div; DeviceState *wm; } mv88w8618_audio_state; @@ -215,9 +215,10 @@ static void mv88w8618_audio_write(void *opaque, target_phys_addr_t offset, } } -static void mv88w8618_audio_reset(void *opaque) +static void mv88w8618_audio_reset(DeviceState *d) { - mv88w8618_audio_state *s = opaque; + mv88w8618_audio_state *s = FROM_SYSBUS(mv88w8618_audio_state, + sysbus_from_qdev(d)); s->playback_mode = 0; s->status = 0; @@ -255,11 +256,31 @@ static int mv88w8618_audio_init(SysBusDevice *dev) return 0; } +static const VMStateDescription mv88w8618_audio_vmsd = { + .name = "mv88w8618_audio", + .version_id = 1, + .minimum_version_id = 1, + .minimum_version_id_old = 1, + .fields = (VMStateField[]) { + VMSTATE_UINT32(playback_mode, mv88w8618_audio_state), + VMSTATE_UINT32(status, mv88w8618_audio_state), + VMSTATE_UINT32(irq_enable, mv88w8618_audio_state), + VMSTATE_UINT32(phys_buf, mv88w8618_audio_state), + VMSTATE_UINT32(target_buffer, mv88w8618_audio_state), + VMSTATE_UINT32(threshold, mv88w8618_audio_state), + VMSTATE_UINT32(play_pos, mv88w8618_audio_state), + VMSTATE_UINT32(last_free, mv88w8618_audio_state), + VMSTATE_UINT32(clock_div, mv88w8618_audio_state), + VMSTATE_END_OF_LIST() + } +}; + static SysBusDeviceInfo mv88w8618_audio_info = { .init = mv88w8618_audio_init, .qdev.name = "mv88w8618_audio", .qdev.size = sizeof(mv88w8618_audio_state), .qdev.reset = mv88w8618_audio_reset, + .qdev.vmsd = &mv88w8618_audio_vmsd, .qdev.props = (Property[]) { { .name = "wm8750", |