From patchwork Tue Jul 30 17:55:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 18674 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D14F4248E6 for ; Tue, 30 Jul 2013 17:55:36 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id n1sf4856359qcx.3 for ; Tue, 30 Jul 2013 10:55:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-removed-original-auth :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=EWN4OBMhGiq2FpIqWjysETtn/MuQUP5Gtfdas0PtFHs=; b=bhywBTvoVU5srvvv91QhrkoUrHY9eyJE2CsZrQRS/pbbDs88lXqRKKXPnmUdrwRope Yy8e0fCt0wbRxOxjGEG9RH5KmznJKCaNW+6mqjWkoYWg7B0J+89zfnPZJd7h7hsLOo61 kYilJU6dwVpIKs14D0QcwG6UhS50C0q472DWsNibJV/3shYiPwTdqij7HLIb+yUODiN2 2agzyXSwMc+ZSJA+OF0GjkGUfWZSzXQupdaORVgjkMlQqs1jTYix2XS5vjw7hQch9Nmy K0FTmvPHW1YL2/0lWFJEIJ6mgj88lFf6e44oL1CJiR2g8GQBSrd3xvX2cQ5xYPFYHV3J 7enQ== X-Received: by 10.236.216.41 with SMTP id f39mr2619929yhp.10.1375206936608; Tue, 30 Jul 2013 10:55:36 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.132.99 with SMTP id ot3ls317133qeb.40.gmail; Tue, 30 Jul 2013 10:55:36 -0700 (PDT) X-Received: by 10.52.180.229 with SMTP id dr5mr2947780vdc.20.1375206936401; Tue, 30 Jul 2013 10:55:36 -0700 (PDT) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by mx.google.com with ESMTPS id w1si19038488vei.148.2013.07.30.10.55.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Jul 2013 10:55:36 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.44 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.44; Received: by mail-vb0-f44.google.com with SMTP id e13so2503399vbg.31 for ; Tue, 30 Jul 2013 10:55:36 -0700 (PDT) X-Received: by 10.220.164.138 with SMTP id e10mr10398440vcy.27.1375206935890; Tue, 30 Jul 2013 10:55:35 -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.221.11.8 with SMTP id pc8csp189217vcb; Tue, 30 Jul 2013 10:55:35 -0700 (PDT) X-Received: by 10.194.7.137 with SMTP id j9mr3101347wja.11.1375206934875; Tue, 30 Jul 2013 10:55:34 -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 jr6si4237514wjc.99.2013.07.30.10.55.34 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 30 Jul 2013 10:55:34 -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.80) (envelope-from ) id 1V4E8z-0003vJ-CO; Tue, 30 Jul 2013 18:55:33 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org Subject: [PATCH 1/4] target-arm: Allow raw_read() and raw_write() to handle 64 bit regs Date: Tue, 30 Jul 2013 18:55:30 +0100 Message-Id: <1375206933-15053-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1375206933-15053-1-git-send-email-peter.maydell@linaro.org> References: <1375206933-15053-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQlUvEIwlKbbqSQLVdc64XQUqFxssChnbjKCM2V1YrfV5Yi8nR3XVrC8UA/pZsTNEp2FlUBH X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.44 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: , Extend the raw_read() and raw_write() helper accessors so that they can be used for 64 bit registers as well as 32 bit registers. Signed-off-by: Peter Maydell --- target-arm/helper.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index 4968391..fc5f757 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -67,14 +67,22 @@ static int vfp_gdb_set_reg(CPUARMState *env, uint8_t *buf, int reg) static int raw_read(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t *value) { - *value = CPREG_FIELD32(env, ri); + if (ri->type & ARM_CP_64BIT) { + *value = CPREG_FIELD64(env, ri); + } else { + *value = CPREG_FIELD32(env, ri); + } return 0; } static int raw_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { - CPREG_FIELD32(env, ri) = value; + if (ri->type & ARM_CP_64BIT) { + CPREG_FIELD64(env, ri) = value; + } else { + CPREG_FIELD32(env, ri) = value; + } return 0; }