Skip to contentSkip to conversation

hw/arm_mptimer: Save the timer state

PATCH In review Peter Maydell 2 participants 2 messages Mar 22, 2013 – Mar 25, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/arm_mptimer: Save the timer state

Add a missing VMSTATE_TIMER() entry to the arm_mptimer vmstate description; this omission meant that we would probably hang on reload when the timer failed to fire.

---
 hw/arm_mptimer.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
hw/arm_mptimer.c +3 -2
index f59a9f1..317f5e4 100644
@@ -253,14 +253,15 @@ static int arm_mptimer_init(SysBusDevice *dev)
 
 static const VMStateDescription vmstate_timerblock = {
     .name = "arm_mptimer_timerblock",
-    .version_id = 1,
-    .minimum_version_id = 1,
+    .version_id = 2,
+    .minimum_version_id = 2,
     .fields = (VMStateField[]) {
         VMSTATE_UINT32(count, TimerBlock),
         VMSTATE_UINT32(load, TimerBlock),
         VMSTATE_UINT32(control, TimerBlock),
         VMSTATE_UINT32(status, TimerBlock),
         VMSTATE_INT64(tick, TimerBlock),
+        VMSTATE_TIMER(timer, TimerBlock),
         VMSTATE_END_OF_LIST()
     }
 };
Signature · 1 line
1.7.9.5
Reviewed-by on v1 1/1
#1 lore raw

Hi Peter,

Quoted 4 lines · Peter Maydell

Add a missing VMSTATE_TIMER() entry to the arm_mptimer vmstate description; this omission meant that we would probably hang on reload when the timer failed to fire.

I know load-save does not work for Zynq Linux. This will definately help get us closer to a working state. Might have another go to see if it gets any further with this. Thanks.

Quoted 1 line
Quoted 30 lines
---
 hw/arm_mptimer.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
hw/arm_mptimer.c +3 -3
index f59a9f1..317f5e4 100644
@@ -253,14 +253,15 @@ static int arm_mptimer_init(SysBusDevice *dev)
 
 static const VMStateDescription vmstate_timerblock = {
     .name = "arm_mptimer_timerblock",
-    .version_id = 1,
-    .minimum_version_id = 1,
+    .version_id = 2,
+    .minimum_version_id = 2,
     .fields = (VMStateField[]) {
         VMSTATE_UINT32(count, TimerBlock),
         VMSTATE_UINT32(load, TimerBlock),
         VMSTATE_UINT32(control, TimerBlock),
         VMSTATE_UINT32(status, TimerBlock),
         VMSTATE_INT64(tick, TimerBlock),
+        VMSTATE_TIMER(timer, TimerBlock),
         VMSTATE_END_OF_LIST()
     }
 };
--

1.7.9.5