From patchwork Fri Mar 1 17:21:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Chouteau X-Patchwork-Id: 224418 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9DA1C2C02F5 for ; Sat, 2 Mar 2013 04:22:18 +1100 (EST) Received: from localhost ([::1]:44887 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBTey-0000Cm-Q8 for incoming@patchwork.ozlabs.org; Fri, 01 Mar 2013 12:22:16 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBTee-00005U-9i for qemu-devel@nongnu.org; Fri, 01 Mar 2013 12:21:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UBTea-0001VP-OW for qemu-devel@nongnu.org; Fri, 01 Mar 2013 12:21:56 -0500 Received: from mel.act-europe.fr ([194.98.77.210]:57024) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBTea-0001UQ-Ez for qemu-devel@nongnu.org; Fri, 01 Mar 2013 12:21:52 -0500 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 5BFA7290034; Fri, 1 Mar 2013 18:21:51 +0100 (CET) X-Virus-Scanned: amavisd-new at eu.adacore.com Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cjAmzTWYQQds; Fri, 1 Mar 2013 18:21:51 +0100 (CET) Received: from PomPomGalli.act-europe.fr (pompomgalli.act-europe.fr [10.10.1.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 3D1C6290038; Fri, 1 Mar 2013 18:21:51 +0100 (CET) From: Fabien Chouteau To: qemu-devel@nongnu.org Date: Fri, 1 Mar 2013 18:21:46 +0100 Message-Id: <1362158507-19310-4-git-send-email-chouteau@adacore.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1362158507-19310-1-git-send-email-chouteau@adacore.com> References: <1362158507-19310-1-git-send-email-chouteau@adacore.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 194.98.77.210 Cc: peter.maydell@linaro.org, paul@codesourcery.com, afaerber@suse.de Subject: [Qemu-devel] [PATCH 3/4] target-arm: Fix VFP register byte order in GDB remote X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From GDB Remote Serial Protocol doc: "The bytes with the register are transmitted in target byte order." Signed-off-by: Fabien Chouteau --- target-arm/helper.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index e97e1a5..75ee0dc 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -16,18 +16,17 @@ static int vfp_gdb_get_reg(CPUARMState *env, uint8_t *buf, int reg) { int nregs; - /* VFP data registers are always little-endian. */ nregs = arm_feature(env, ARM_FEATURE_VFP3) ? 32 : 16; if (reg < nregs) { - stfq_le_p(buf, env->vfp.regs[reg]); + stfq_p(buf, env->vfp.regs[reg]); return 8; } if (arm_feature(env, ARM_FEATURE_NEON)) { /* Aliases for Q regs. */ nregs += 16; if (reg < nregs) { - stfq_le_p(buf, env->vfp.regs[(reg - 32) * 2]); - stfq_le_p(buf + 8, env->vfp.regs[(reg - 32) * 2 + 1]); + stfq_p(buf, env->vfp.regs[(reg - 32) * 2]); + stfq_p(buf + 8, env->vfp.regs[(reg - 32) * 2 + 1]); return 16; } } @@ -45,14 +44,14 @@ static int vfp_gdb_set_reg(CPUARMState *env, uint8_t *buf, int reg) nregs = arm_feature(env, ARM_FEATURE_VFP3) ? 32 : 16; if (reg < nregs) { - env->vfp.regs[reg] = ldfq_le_p(buf); + env->vfp.regs[reg] = ldfq_p(buf); return 8; } if (arm_feature(env, ARM_FEATURE_NEON)) { nregs += 16; if (reg < nregs) { - env->vfp.regs[(reg - 32) * 2] = ldfq_le_p(buf); - env->vfp.regs[(reg - 32) * 2 + 1] = ldfq_le_p(buf + 8); + env->vfp.regs[(reg - 32) * 2] = ldfq_p(buf); + env->vfp.regs[(reg - 32) * 2 + 1] = ldfq_p(buf + 8); return 16; } }