All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: Thomas Huth <huth@tuxfamily.org>, Laurent Vivier <laurent@vivier.eu>
Subject: [PATCH 10/11] hw/m68k/next-cube: Add vmstate for NeXTPC device
Date: Fri, 15 Jan 2021 20:12:05 +0000	[thread overview]
Message-ID: <20210115201206.17347-11-peter.maydell@linaro.org> (raw)
In-Reply-To: <20210115201206.17347-1-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>
---
 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 dd0a2a5aea0..9eb1e31752b 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
@@ -890,6 +891,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);
@@ -898,7 +930,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.20.1



  parent reply	other threads:[~2021-01-15 20:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-15 20:11 [PATCH 00/11] hw/m68k/next-cube: refactor to fix Coverity issue Peter Maydell
2021-01-15 20:11 ` [PATCH 01/11] hw/m68k/next-cube: Make next_irq() function static Peter Maydell
2021-01-16  6:46   ` Thomas Huth
2021-01-15 20:11 ` [PATCH 02/11] hw/m68k/next-cube: Move register/interrupt functionality into a device Peter Maydell
2021-01-15 20:11 ` [PATCH 03/11] hw/m68k/next-cube: Move mmio_ops into NeXTPC device Peter Maydell
2021-01-16  7:09   ` Thomas Huth
2021-01-15 20:11 ` [PATCH 04/11] hw/m68k/next-cube: Move scr_ops " Peter Maydell
2021-01-16  8:18   ` Thomas Huth
2021-01-15 20:12 ` [PATCH 05/11] hw/m68k/next-cube: Make next_irq take NeXTPC* as its opaque Peter Maydell
2021-01-16  8:39   ` Thomas Huth
2021-01-15 20:12 ` [PATCH 06/11] hw/m68k/next-cube: Move int_status and int_mask to NeXTPC struct Peter Maydell
2021-01-16  8:40   ` Thomas Huth
2021-01-15 20:12 ` [PATCH 07/11] hw/m68k/next-cube: Make next_irq GPIO inputs to NEXT_PC device Peter Maydell
2021-01-16 10:24   ` Thomas Huth
2021-01-15 20:12 ` [PATCH 08/11] hw/m68k/next-cube: Move rtc into NeXTPC struct Peter Maydell
2021-01-16 10:35   ` Thomas Huth
2021-01-15 20:12 ` [PATCH 09/11] hw/m68k/next-cube: Remove unused fields from NeXTState Peter Maydell
2021-01-16 10:43   ` Thomas Huth
2021-01-15 20:12 ` Peter Maydell [this message]
2021-01-16 10:44   ` [PATCH 10/11] hw/m68k/next-cube: Add vmstate for NeXTPC device Thomas Huth
2021-01-15 20:12 ` [PATCH 11/11] hw/m68k/next-cube: Add missing header comment to next-cube.h Peter Maydell
2021-01-16  7:36   ` Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210115201206.17347-11-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=huth@tuxfamily.org \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.