From patchwork Tue Mar 19 17:41:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Chouteau X-Patchwork-Id: 229159 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 D70612C00B7 for ; Wed, 20 Mar 2013 04:42:37 +1100 (EST) Received: from localhost ([::1]:60714 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI0YW-0001Pz-4P for incoming@patchwork.ozlabs.org; Tue, 19 Mar 2013 13:42:36 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI0Xv-0000rD-PL for qemu-devel@nongnu.org; Tue, 19 Mar 2013 13:42:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UI0Xt-0003eQ-NV for qemu-devel@nongnu.org; Tue, 19 Mar 2013 13:41:59 -0400 Received: from mel.act-europe.fr ([194.98.77.210]:52283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI0Xt-0003dv-Dc; Tue, 19 Mar 2013 13:41:57 -0400 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 9C8A5290046; Tue, 19 Mar 2013 18:41:56 +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 W25eoLKk3E0b; Tue, 19 Mar 2013 18:41:56 +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 74607290045; Tue, 19 Mar 2013 18:41:56 +0100 (CET) From: Fabien Chouteau To: qemu-devel@nongnu.org Date: Tue, 19 Mar 2013 18:41:53 +0100 Message-Id: <1363714913-3804-1-git-send-email-chouteau@adacore.com> X-Mailer: git-send-email 1.7.9.5 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, qemu-ppc@nongnu.org, agraf@suse.de Subject: [Qemu-devel] [PATCH V2] PPC/GDB: handle read and write of fpscr 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 Although the support of this register may be uncomplete, there are no reason to prevent the debugger from reading or writing it. Signed-off-by: Fabien Chouteau --- gdbstub.c | 3 ++- target-ppc/cpu.h | 2 ++ target-ppc/fpu_helper.c | 5 +++++ target-ppc/translate_init.c | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index e414ad9..d12ce52 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -781,7 +781,8 @@ static int cpu_gdb_write_register(CPUPPCState *env, uint8_t *mem_buf, int n) /* fpscr */ if (gdb_has_xml) return 0; - return 4; + store_fpscr(env, ldtul_p(mem_buf), 0xffffffff); + return sizeof(target_ulong); } } return 0; diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h index 417abb0..543f367 100644 --- a/target-ppc/cpu.h +++ b/target-ppc/cpu.h @@ -1181,6 +1181,8 @@ void ppc_tlb_invalidate_one (CPUPPCState *env, target_ulong addr); #endif #endif +void store_fpscr(CPUPPCState *env, uint64_t arg, uint32_t mask); + static inline uint64_t ppc_dump_gpr(CPUPPCState *env, int gprn) { uint64_t gprv; diff --git a/target-ppc/fpu_helper.c b/target-ppc/fpu_helper.c index 9d67926..9e779ea 100644 --- a/target-ppc/fpu_helper.c +++ b/target-ppc/fpu_helper.c @@ -463,6 +463,11 @@ void helper_store_fpscr(CPUPPCState *env, uint64_t arg, uint32_t mask) fpscr_set_rounding_mode(env); } +void store_fpscr(CPUPPCState *env, uint64_t arg, uint32_t mask) +{ + helper_store_fpscr(env, arg, mask); +} + void helper_float_check_status(CPUPPCState *env) { if (env->exception_index == POWERPC_EXCP_PROGRAM && diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index 09ad4ba..8511b2f 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -7693,7 +7693,7 @@ static int gdb_set_float_reg(CPUPPCState *env, uint8_t *mem_buf, int n) return 8; } if (n == 32) { - /* FPSCR not implemented */ + helper_store_fpscr(env, ldl_p(mem_buf), 0xffffffff); return 4; } return 0;