From patchwork Tue Jan 19 08:36:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 366151 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp546190jam; Tue, 19 Jan 2021 00:42:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJyjLRYf+IrRj6fRVhQawQ7IJmUvAl+UaBj7jYJ8cNAsVFsiPFjOWqWDsmteUWhKwJfEsdHg X-Received: by 2002:a25:99c6:: with SMTP id q6mr4475227ybo.408.1611045722224; Tue, 19 Jan 2021 00:42:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611045722; cv=none; d=google.com; s=arc-20160816; b=YCJd+eMZmjgaS3z+hNFOZifXCXVEslhdwyH5EwHm5nuTs0IXJ38FBFw+loHEsfSNNZ 8tN9EFsYhU3IHbnYGrzguUxe3ean0dXHEGVM1n+n6/sc1zCbNaICIfHQxAXGNK08wzXa DI3cZr6GFjQwZmNYrys3gYJVzFslBdKVhY2dZ1O0d6QyAe/CnYeJF1lAwHcmHmxNqWYB jpAJ2wFFWyIXqWaXj8FzR2IQENyxZkleibZavRYl0KleUBoBUjWZ+Sg0C5TsPyCibQ7G aEMmnAWY4dTv8KcfddKxjas7f5xcJMvnw7TVUv+Aiz9zPEB9VabakkWqmKZINQz4KPC2 Ra1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=82040SlXkePZdzPsM+5O3xrDuN6hQ94MWNkWdWB/RtM=; b=XZUWY8yVDxaO5/Bg7D3sSI5xuNkd9klCthmpcBYL1tz+CKOvJTNaS2XQ2zYcGR3Om9 koaCHWivEnMil0i/IDikTGlMX6nww1NEpVfQVTtQuF8Jn5jmQbhXIlSx5rax5TyiJ4f+ 1EC1fivG5dTcAhmavPVldb2Ezfy3r4mX2vSUlRokRGRS4FbPcJZISOPdJsqBOVph9VWp gX5+HRNHq5bRc3oXoAHsc3R0ORz93QcHfzO99Upe6aKbZ1nKJbBbnpyXY0XPFLHt/tzg //t1Gl0FeHXh204mk3Kfnk4DIvQGrYOqWig0syQ9IGlGnVXz8t8lEvocxsthfnLkm689 w/JQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x18si19320639ybj.403.2021.01.19.00.42.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Jan 2021 00:42:02 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:43272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1maP-00072L-NN for patch@linaro.org; Tue, 19 Jan 2021 03:42:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1mVb-0008La-DD for qemu-devel@nongnu.org; Tue, 19 Jan 2021 03:37:03 -0500 Received: from mail-wm1-f50.google.com ([209.85.128.50]:40845) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l1mVZ-0003WI-1V for qemu-devel@nongnu.org; Tue, 19 Jan 2021 03:37:02 -0500 Received: by mail-wm1-f50.google.com with SMTP id c127so454462wmf.5 for ; Tue, 19 Jan 2021 00:37:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=82040SlXkePZdzPsM+5O3xrDuN6hQ94MWNkWdWB/RtM=; b=SOcNXFGq6JsB/0JhUXprh2DS4FlsHfu+L31+EpcMvotInLIiMhzAEX33bTYiuuG6eB MunPJV3PTskGk0vEoPyJFkc1bVtxNq4804liPVWS0QbnseVNmRCPt+gWGJ3AD86PRXEQ gTuRPlB1FZQOWQhERjtp1aqjiE6LOl7XPVWLJQY34MvNJi6gnxPDp9l+5+ctu3Ot/oTf oAm1jtp1qZWevMUA4sfjlY/WeVBJPZ9gVbqETgWHBaBgRrl7OmpFMD7bZbBeFyzC674W 0jayJqhHvOXOLqd+M+2STlHPdmEwnxLqNFOMCuRQaIvQqPGy+QTxy14dmSynFZVnBsZG l9Og== X-Gm-Message-State: AOAM533h+StK5wkYd3WarKKXzpmtSmDFxkpVC4P3+GGcX7dkEnYnqc0q nWK+8HvDL0m40Gr5seV8QL+GFgpTuA8= X-Received: by 2002:a7b:c31a:: with SMTP id k26mr2924228wmj.72.1611045419262; Tue, 19 Jan 2021 00:36:59 -0800 (PST) Received: from localhost.localdomain (pd9e83aed.dip0.t-ipconnect.de. [217.232.58.237]) by smtp.gmail.com with ESMTPSA id z14sm540833wrm.5.2021.01.19.00.36.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jan 2021 00:36:59 -0800 (PST) From: Thomas Huth To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 10/11] hw/m68k/next-cube: Add vmstate for NeXTPC device Date: Tue, 19 Jan 2021 09:36:16 +0100 Message-Id: <20210119083617.6337-11-huth@tuxfamily.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210119083617.6337-1-huth@tuxfamily.org> References: <20210119083617.6337-1-huth@tuxfamily.org> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.128.50; envelope-from=th.huth@gmail.com; helo=mail-wm1-f50.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell 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 Message-Id: <20210115201206.17347-11-peter.maydell@linaro.org> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) -- 2.29.2 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 = {