From patchwork Mon Apr 8 15:51:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 15985 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5869523900 for ; Mon, 8 Apr 2013 15:52:04 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id gd11sf3338207vcb.9 for ; Mon, 08 Apr 2013 08:51:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=GBxATAqdE/0NKEtEY1y/nMsexKkfeskUmQChHaG+tOA=; b=dJeS9Yetknzd1DFxDHq4Mr0MfSTo8jFbgt9lXOebtRNIPeXIRltXuU9PxpnxfoPjlT u6Sb2itOVG3CBaj4cKkzjUqc04h+ojcBeAuyWPajvoLZyTo8fBLFH7NQdyQ6c4ZMu2eg m09mlbE+eqcco/zDOviiq+3JJuhp2hJ4UYZW4fAV7mRZB/iERLq+ZIhBvfKkmq0KVmED YCTkGYr3zU6QIeJlTdao8b7krTKgcwEl3EEO5kE0DHIilLyDgkNXY+7bVmjwwMZigFw9 qPYDu2/YSak2YwUggOmfyNo16utqk8YyufuUN4RNT1JopoDweCurNWLHoGza9WdHoj6p FvMA== X-Received: by 10.236.119.170 with SMTP id n30mr10171789yhh.51.1365436309450; Mon, 08 Apr 2013 08:51:49 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.41.10 with SMTP id b10ls3323494qel.72.gmail; Mon, 08 Apr 2013 08:51:49 -0700 (PDT) X-Received: by 10.58.90.5 with SMTP id bs5mr15972677veb.60.1365436309310; Mon, 08 Apr 2013 08:51:49 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id tt5si18700564vec.13.2013.04.08.08.51.49 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Apr 2013 08:51:49 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id hr11so1296206vcb.8 for ; Mon, 08 Apr 2013 08:51:49 -0700 (PDT) X-Received: by 10.52.93.20 with SMTP id cq20mr13928164vdb.38.1365436309056; Mon, 08 Apr 2013 08:51:49 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.85.136 with SMTP id h8csp24538vez; Mon, 8 Apr 2013 08:51:48 -0700 (PDT) X-Received: by 10.180.11.238 with SMTP id t14mr13823080wib.3.1365436307945; Mon, 08 Apr 2013 08:51:47 -0700 (PDT) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id wm9si720435wjc.4.2013.04.08.08.51.47 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 08 Apr 2013 08:51:47 -0700 (PDT) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1UPEME-0005FT-7O; Mon, 08 Apr 2013 16:51:46 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, qemu-trivial@nongnu.org, Anthony Green Subject: [PATCH] target-moxie: Fix VMState registration Date: Mon, 8 Apr 2013 16:51:46 +0100 Message-Id: <1365436306-20152-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-Gm-Message-State: ALoCoQkLXmWOzNlRPWAKJrBKaaNwj56l65iUWzpQnHZDIhA0R5YUPHH6k2d3FvQSPz/rFCtB6lar X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Register the CPU VMState in the correct way, via cpu_class_set_vmsd(), rather than doing it in two different wrong ways (once by providing cpu_save and cpu_load functions, and once by setting the vmsd field in DeviceClass). Signed-off-by: Peter Maydell Reviewed-by: Andreas Färber --- Having just revamped the target-arm vmstate code I now have a better grasp of how it should work, so I noticed we didn't quite get moxie right. Not really very tested since I couldn't find a test image to try, but should work better than the previous code... target-moxie/cpu.c | 2 +- target-moxie/cpu.h | 2 -- target-moxie/machine.c | 12 +----------- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/target-moxie/cpu.c b/target-moxie/cpu.c index c0855f0..f2b0791 100644 --- a/target-moxie/cpu.c +++ b/target-moxie/cpu.c @@ -97,7 +97,7 @@ static void moxie_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = moxie_cpu_class_by_name; - dc->vmsd = &vmstate_moxie_cpu; + cpu_class_set_vmsd(cc, &vmstate_moxie_cpu); cc->do_interrupt = moxie_cpu_do_interrupt; } diff --git a/target-moxie/cpu.h b/target-moxie/cpu.h index 988729a..a9d9ace 100644 --- a/target-moxie/cpu.h +++ b/target-moxie/cpu.h @@ -28,8 +28,6 @@ #define TARGET_HAS_ICE 1 -#define CPU_SAVE_VERSION 1 - #define ELF_MACHINE 0xFEED /* EM_MOXIE */ #define MOXIE_EX_DIV0 0 diff --git a/target-moxie/machine.c b/target-moxie/machine.c index 5bfdb28..0f5992b 100644 --- a/target-moxie/machine.c +++ b/target-moxie/machine.c @@ -3,7 +3,7 @@ const VMStateDescription vmstate_moxie_cpu = { .name = "cpu", - .version_id = CPU_SAVE_VERSION, + .version_id = 1, .minimum_version_id = 1, .minimum_version_id_old = 1, .fields = (VMStateField[]) { @@ -16,13 +16,3 @@ const VMStateDescription vmstate_moxie_cpu = { VMSTATE_END_OF_LIST() } }; - -void cpu_save(QEMUFile *f, void *opaque) -{ - vmstate_save_state(f, &vmstate_moxie_cpu, opaque); -} - -int cpu_load(QEMUFile *f, void *opaque, int version_id) -{ - return vmstate_load_state(f, &vmstate_moxie_cpu, opaque, version_id); -}