[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/11] hw/m68k/next-cube: Add vmstate for NeXTPC device
From: |
Thomas Huth |
Subject: |
[PULL 10/11] hw/m68k/next-cube: Add vmstate for NeXTPC device |
Date: |
Tue, 19 Jan 2021 09:36:16 +0100 |
From: Peter Maydell <peter.maydell@linaro.org>
Add the vmstate for the new NeXTPC devic; this is in theory
a migration compatibility break, but this machine doesn't have
working migration currently anyway.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20210115201206.17347-11-peter.maydell@linaro.org>
Signed-off-by: Thomas Huth <huth@tuxfamily.org>
---
hw/m68k/next-cube.c | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c
index 1f6a2d58a1..92b45d760f 100644
--- a/hw/m68k/next-cube.c
+++ b/hw/m68k/next-cube.c
@@ -28,6 +28,7 @@
#include "qapi/error.h"
#include "ui/console.h"
#include "target/m68k/cpu.h"
+#include "migration/vmstate.h"
/* #define DEBUG_NEXT */
#ifdef DEBUG_NEXT
@@ -891,6 +892,37 @@ static Property next_pc_properties[] = {
DEFINE_PROP_END_OF_LIST(),
};
+static const VMStateDescription next_rtc_vmstate = {
+ .name = "next-rtc",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .fields = (VMStateField[]) {
+ VMSTATE_UINT8_ARRAY(ram, NextRtc, 32),
+ VMSTATE_UINT8(command, NextRtc),
+ VMSTATE_UINT8(value, NextRtc),
+ VMSTATE_UINT8(status, NextRtc),
+ VMSTATE_UINT8(control, NextRtc),
+ VMSTATE_UINT8(retval, NextRtc),
+ VMSTATE_END_OF_LIST()
+ },
+};
+
+static const VMStateDescription next_pc_vmstate = {
+ .name = "next-pc",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .fields = (VMStateField[]) {
+ VMSTATE_UINT32(scr1, NeXTPC),
+ VMSTATE_UINT32(scr2, NeXTPC),
+ VMSTATE_UINT32(int_mask, NeXTPC),
+ VMSTATE_UINT32(int_status, NeXTPC),
+ VMSTATE_UINT8(scsi_csr_1, NeXTPC),
+ VMSTATE_UINT8(scsi_csr_2, NeXTPC),
+ VMSTATE_STRUCT(rtc, NeXTPC, 0, next_rtc_vmstate, NextRtc),
+ VMSTATE_END_OF_LIST()
+ },
+};
+
static void next_pc_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -899,7 +931,7 @@ static void next_pc_class_init(ObjectClass *klass, void
*data)
dc->realize = next_pc_realize;
dc->reset = next_pc_reset;
device_class_set_props(dc, next_pc_properties);
- /* We will add the VMState in a later commit */
+ dc->vmsd = &next_pc_vmstate;
}
static const TypeInfo next_pc_info = {
--
2.29.2
- [PULL 00/11] m68k next-cube patches, Thomas Huth, 2021/01/19
- [PULL 01/11] hw/m68k/next-cube: Make next_irq() function static, Thomas Huth, 2021/01/19
- [PULL 02/11] hw/m68k/next-cube: Move register/interrupt functionality into a device, Thomas Huth, 2021/01/19
- [PULL 03/11] hw/m68k/next-cube: Move mmio_ops into NeXTPC device, Thomas Huth, 2021/01/19
- [PULL 05/11] hw/m68k/next-cube: Make next_irq take NeXTPC* as its opaque, Thomas Huth, 2021/01/19
- [PULL 10/11] hw/m68k/next-cube: Add vmstate for NeXTPC device,
Thomas Huth <=
- [PULL 04/11] hw/m68k/next-cube: Move scr_ops into NeXTPC device, Thomas Huth, 2021/01/19
- [PULL 11/11] hw/m68k/next-cube: Add missing header comment to next-cube.h, Thomas Huth, 2021/01/19
- [PULL 06/11] hw/m68k/next-cube: Move int_status and int_mask to NeXTPC struct, Thomas Huth, 2021/01/19
- [PULL 07/11] hw/m68k/next-cube: Make next_irq GPIO inputs to NEXT_PC device, Thomas Huth, 2021/01/19
- [PULL 08/11] hw/m68k/next-cube: Move rtc into NeXTPC struct, Thomas Huth, 2021/01/19
- [PULL 09/11] hw/m68k/next-cube: Remove unused fields from NeXTState, Thomas Huth, 2021/01/19
- Re: [PULL 00/11] m68k next-cube patches, Peter Maydell, 2021/01/19