summary refs log tree commit diff stats
path: root/hw/rtc/aspeed_rtc.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2023-08-31 09:45:18 +0100
committerPeter Maydell <peter.maydell@linaro.org>2023-08-31 09:45:18 +0100
commitc0a63857282afebaeed606a3dca803bb3bfb6aa3 (patch)
treef574b414e4bc8e1bf9dd799043126ae8bc617f88 /hw/rtc/aspeed_rtc.c
parent279695a4a4472c41d8764317e4fae04d93ee2b42 (diff)
downloadfocaccia-qemu-c0a63857282afebaeed606a3dca803bb3bfb6aa3.tar.gz
focaccia-qemu-c0a63857282afebaeed606a3dca803bb3bfb6aa3.zip
hw/rtc/aspeed_rtc: Use 64-bit offset for holding time_t difference
In the aspeed_rtc device we store a difference between two time_t
values in an 'int'. This is not really correct when time_t could
be 64 bits. Enlarge the field to 'int64_t'.

This is a migration compatibility break for the aspeed boards.
While we are changing the vmstate, remove the accidental
duplicate of the offset field.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'hw/rtc/aspeed_rtc.c')
-rw-r--r--hw/rtc/aspeed_rtc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/rtc/aspeed_rtc.c b/hw/rtc/aspeed_rtc.c
index f6da7b666d..fa861e2d49 100644
--- a/hw/rtc/aspeed_rtc.c
+++ b/hw/rtc/aspeed_rtc.c
@@ -136,11 +136,10 @@ static const MemoryRegionOps aspeed_rtc_ops = {
 
 static const VMStateDescription vmstate_aspeed_rtc = {
     .name = TYPE_ASPEED_RTC,
-    .version_id = 1,
+    .version_id = 2,
     .fields = (VMStateField[]) {
         VMSTATE_UINT32_ARRAY(reg, AspeedRtcState, 0x18),
-        VMSTATE_INT32(offset, AspeedRtcState),
-        VMSTATE_INT32(offset, AspeedRtcState),
+        VMSTATE_INT64(offset, AspeedRtcState),
         VMSTATE_END_OF_LIST()
     }
 };