[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 20/24] hw/rtc/aspeed_rtc: Use 64-bit offset for holding time_t dif
From: |
Peter Maydell |
Subject: |
[PULL 20/24] hw/rtc/aspeed_rtc: Use 64-bit offset for holding time_t difference |
Date: |
Thu, 31 Aug 2023 11:45:15 +0100 |
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>
---
include/hw/rtc/aspeed_rtc.h | 2 +-
hw/rtc/aspeed_rtc.c | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/include/hw/rtc/aspeed_rtc.h b/include/hw/rtc/aspeed_rtc.h
index df61e46059e..596dfebb46c 100644
--- a/include/hw/rtc/aspeed_rtc.h
+++ b/include/hw/rtc/aspeed_rtc.h
@@ -18,7 +18,7 @@ struct AspeedRtcState {
qemu_irq irq;
uint32_t reg[0x18];
- int offset;
+ int64_t offset;
};
diff --git a/hw/rtc/aspeed_rtc.c b/hw/rtc/aspeed_rtc.c
index f6da7b666d6..fa861e2d494 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()
}
};
--
2.34.1
- [PULL 14/24] Refactor i.MX7 processor code, (continued)
- [PULL 14/24] Refactor i.MX7 processor code, Peter Maydell, 2023/08/31
- [PULL 08/24] target/arm: Suppress FEAT_TRBE (Trace Buffer Extension), Peter Maydell, 2023/08/31
- [PULL 12/24] Refactor i.MX6UL processor code, Peter Maydell, 2023/08/31
- [PULL 21/24] rtc: Use time_t for passing and returning time offsets, Peter Maydell, 2023/08/31
- [PULL 15/24] Add i.MX7 missing TZ devices and memory regions, Peter Maydell, 2023/08/31
- [PULL 16/24] Add i.MX7 SRC device implementation, Peter Maydell, 2023/08/31
- [PULL 24/24] hw/arm: Set number of MPU regions correctly for an505, an521, an524, Peter Maydell, 2023/08/31
- [PULL 23/24] hw/arm/armv7m: Add mpu-ns-regions and mpu-s-regions properties, Peter Maydell, 2023/08/31
- [PULL 17/24] target/arm: Catch illegal-exception-return from EL3 with bad NSE/NS, Peter Maydell, 2023/08/31
- [PULL 18/24] hw/rtc/m48t59: Use 64-bit arithmetic in set_alarm(), Peter Maydell, 2023/08/31
- [PULL 20/24] hw/rtc/aspeed_rtc: Use 64-bit offset for holding time_t difference,
Peter Maydell <=
- [PULL 22/24] target/arm: Do all "ARM_FEATURE_X implies Y" checks in post_init, Peter Maydell, 2023/08/31
- [PULL 19/24] hw/rtc/twl92230: Use int64_t for sec_offset and alm_sec, Peter Maydell, 2023/08/31
- [PULL 05/24] target/arm: Introduce make_ccsidr64, Peter Maydell, 2023/08/31
- [PULL 11/24] Remove i.MX7 IOMUX GPR device from i.MX6UL, Peter Maydell, 2023/08/31
- Re: [PULL 00/24] target-arm queue, Stefan Hajnoczi, 2023/08/31