[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 1/9] hw/timer/etraxfs_timer: Add vmstate for ETRAX timers
From: |
Laurent Vivier |
Subject: |
[PULL 1/9] hw/timer/etraxfs_timer: Add vmstate for ETRAX timers |
Date: |
Tue, 18 Jan 2022 13:28:39 +0100 |
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Add the vmstate for the ETRAX timers.
This is in theory a migration compatibility break
for the 'AXIS devboard 88' CRIS machine.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20211106105623.510868-1-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
hw/timer/etraxfs_timer.c | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/hw/timer/etraxfs_timer.c b/hw/timer/etraxfs_timer.c
index 4ba662190de3..139e5b86a447 100644
--- a/hw/timer/etraxfs_timer.c
+++ b/hw/timer/etraxfs_timer.c
@@ -26,6 +26,7 @@
#include "hw/sysbus.h"
#include "sysemu/reset.h"
#include "sysemu/runstate.h"
+#include "migration/vmstate.h"
#include "qemu/module.h"
#include "qemu/timer.h"
#include "hw/irq.h"
@@ -64,7 +65,7 @@ struct ETRAXTimerState {
ptimer_state *ptimer_t1;
ptimer_state *ptimer_wd;
- int wd_hits;
+ uint32_t wd_hits;
/* Control registers. */
uint32_t rw_tmr0_div;
@@ -83,6 +84,36 @@ struct ETRAXTimerState {
uint32_t r_masked_intr;
};
+static const VMStateDescription vmstate_etraxfs = {
+ .name = "etraxfs",
+ .version_id = 0,
+ .minimum_version_id = 0,
+ .fields = (VMStateField[]) {
+ VMSTATE_PTIMER(ptimer_t0, ETRAXTimerState),
+ VMSTATE_PTIMER(ptimer_t1, ETRAXTimerState),
+ VMSTATE_PTIMER(ptimer_wd, ETRAXTimerState),
+
+ VMSTATE_UINT32(wd_hits, ETRAXTimerState),
+
+ VMSTATE_UINT32(rw_tmr0_div, ETRAXTimerState),
+ VMSTATE_UINT32(r_tmr0_data, ETRAXTimerState),
+ VMSTATE_UINT32(rw_tmr0_ctrl, ETRAXTimerState),
+
+ VMSTATE_UINT32(rw_tmr1_div, ETRAXTimerState),
+ VMSTATE_UINT32(r_tmr1_data, ETRAXTimerState),
+ VMSTATE_UINT32(rw_tmr1_ctrl, ETRAXTimerState),
+
+ VMSTATE_UINT32(rw_wd_ctrl, ETRAXTimerState),
+
+ VMSTATE_UINT32(rw_intr_mask, ETRAXTimerState),
+ VMSTATE_UINT32(rw_ack_intr, ETRAXTimerState),
+ VMSTATE_UINT32(r_intr, ETRAXTimerState),
+ VMSTATE_UINT32(r_masked_intr, ETRAXTimerState),
+
+ VMSTATE_END_OF_LIST()
+ }
+};
+
static uint64_t
timer_read(void *opaque, hwaddr addr, unsigned int size)
{
@@ -357,6 +388,7 @@ static void etraxfs_timer_class_init(ObjectClass *klass,
void *data)
ResettableClass *rc = RESETTABLE_CLASS(klass);
dc->realize = etraxfs_timer_realize;
+ dc->vmsd = &vmstate_etraxfs;
rc->phases.enter = etraxfs_timer_reset_enter;
rc->phases.hold = etraxfs_timer_reset_hold;
}
--
2.34.1
- [PULL 0/9] Trivial branch for 7.0 patches, Laurent Vivier, 2022/01/18
- [PULL 3/9] qdev-core.h: Fix wrongly named reference to TYPE_SPLIT_IRQ, Laurent Vivier, 2022/01/18
- [PULL 1/9] hw/timer/etraxfs_timer: Add vmstate for ETRAX timers,
Laurent Vivier <=
- [PULL 4/9] tests: Fix typo in check-help output, Laurent Vivier, 2022/01/18
- [PULL 6/9] linux-user: Fix comment typo in arm cpu_loop code, Laurent Vivier, 2022/01/18
- [PULL 2/9] hw/scsi/megasas: Simplify using the ldst API, Laurent Vivier, 2022/01/18
- [PULL 7/9] linux-user: Rename user_force_sig tracepoint to match function name, Laurent Vivier, 2022/01/18
- [PULL 9/9] linux-user: Remove MAX_SIGQUEUE_SIZE, Laurent Vivier, 2022/01/18
- [PULL 8/9] linux-user: Return void from queue_signal(), Laurent Vivier, 2022/01/18
- [PULL 5/9] softmmu: Provide a clue as to why device tree loading failed, Laurent Vivier, 2022/01/18
- Re: [PULL 0/9] Trivial branch for 7.0 patches, Peter Maydell, 2022/01/19