From patchwork Tue Sep 30 21:49:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 38209 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E5C5D2032C for ; Tue, 30 Sep 2014 22:07:54 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id y10sf855712wgg.1 for ; Tue, 30 Sep 2014 15:07:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=kqgcSbSZH3qIPIi8eg4oQ7Zu71eRVt7mJ5elMuy+tUI=; b=MbFKrtDxi9ioxWLBbDh/5m0SVJeOQ/ePOwFHLYN+1viKSt5Xk1en5hAkDnr9LvzXsz 7SFGJMOsC2td4FRloEosPOjJXv6/V/0fvzA2neTuCqabcyLA8vXWDL5/UEsie2PgRrub AY7dJ5GiBUlIlU4T+FDZxJa1pOrtRnMQVvm+Dp7fKo8AMruZY9ToxZPqpomFmyyzgmY3 nUUD5sq4vnPAAtTG88mBzYMzzslSYj4UwTYN7DrQB/f4aDl8ec2J9oqOM9zwdgZ2u4l4 nMoWNDTQLQdjI7xx5zFWYt6bK/kylTo2ZPKiYNZL2oJ9xuoKzPJ2jcmxYt/0zaDDfPrR lmkg== X-Gm-Message-State: ALoCoQnte/cs4sXoAuth3YMNIpmdjYRKhN/keCaf5kZOVd6jimBfcvixeB7DLsgy1POXF6RhEcCS X-Received: by 10.112.48.41 with SMTP id i9mr836lbn.22.1412114874023; Tue, 30 Sep 2014 15:07:54 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.165 with SMTP id f5ls97067lam.33.gmail; Tue, 30 Sep 2014 15:07:53 -0700 (PDT) X-Received: by 10.112.52.68 with SMTP id r4mr48107309lbo.31.1412114873880; Tue, 30 Sep 2014 15:07:53 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com [209.85.215.51]) by mx.google.com with ESMTPS id ul7si24663275lbb.8.2014.09.30.15.07.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Sep 2014 15:07:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by mail-la0-f51.google.com with SMTP id gq15so1183723lab.10 for ; Tue, 30 Sep 2014 15:07:53 -0700 (PDT) X-Received: by 10.152.5.168 with SMTP id t8mr49900154lat.67.1412114873558; Tue, 30 Sep 2014 15:07:53 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp431189lbb; Tue, 30 Sep 2014 15:07:52 -0700 (PDT) X-Received: by 10.140.42.5 with SMTP id b5mr60146751qga.27.1412114872336; Tue, 30 Sep 2014 15:07:52 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id a14si19121901qag.73.2014.09.30.15.07.51 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 30 Sep 2014 15:07:52 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Received: from localhost ([::1]:46671 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ5aJ-0002on-IE for patch@linaro.org; Tue, 30 Sep 2014 18:07:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ5K4-0001N8-AX for qemu-devel@nongnu.org; Tue, 30 Sep 2014 17:51:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XZ5Jy-000472-7S for qemu-devel@nongnu.org; Tue, 30 Sep 2014 17:51:04 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:57310) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ5Jx-000456-Ps for qemu-devel@nongnu.org; Tue, 30 Sep 2014 17:50:58 -0400 Received: by mail-pa0-f54.google.com with SMTP id ey11so8752935pad.27 for ; Tue, 30 Sep 2014 14:50:43 -0700 (PDT) X-Received: by 10.66.165.36 with SMTP id yv4mr72307619pab.23.1412113843088; Tue, 30 Sep 2014 14:50:43 -0700 (PDT) Received: from gbellows-linaro.qualcomm.com (rrcs-67-52-129-61.west.biz.rr.com. [67.52.129.61]) by mx.google.com with ESMTPSA id qy1sm16027662pbc.27.2014.09.30.14.50.41 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Sep 2014 14:50:42 -0700 (PDT) From: Greg Bellows To: qemu-devel@nongnu.org, peter.maydell@linaro.org, serge.fdrv@gmail.com, edgar.iglesias@gmail.com, aggelerf@ethz.ch Date: Tue, 30 Sep 2014 16:49:44 -0500 Message-Id: <1412113785-21525-33-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1412113785-21525-1-git-send-email-greg.bellows@linaro.org> References: <1412113785-21525-1-git-send-email-greg.bellows@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.220.54 Cc: Greg Bellows Subject: [Qemu-devel] [PATCH v5 32/33] target-arm: add GDB scr register 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: greg.bellows@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Added the ability to print the scr register like can be done with the cpsr. Signed-off-by: Greg Bellows --- gdb-xml/arm-core.xml | 1 + target-arm/cpu.c | 2 +- target-arm/cpu.h | 2 ++ target-arm/gdbstub.c | 3 +++ target-arm/helper.c | 5 +++++ 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/gdb-xml/arm-core.xml b/gdb-xml/arm-core.xml index 6012f34..b63b998 100644 --- a/gdb-xml/arm-core.xml +++ b/gdb-xml/arm-core.xml @@ -28,4 +28,5 @@ the FPA registers historically were placed between the PC and the CPSR in the "g" packet. --> + diff --git a/target-arm/cpu.c b/target-arm/cpu.c index 2a5c333..ea2169b 100644 --- a/target-arm/cpu.c +++ b/target-arm/cpu.c @@ -1116,7 +1116,7 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) cc->get_phys_page_debug = arm_cpu_get_phys_page_debug; cc->vmsd = &vmstate_arm_cpu; #endif - cc->gdb_num_core_regs = 26; + cc->gdb_num_core_regs = 27; cc->gdb_core_xml_file = "arm-core.xml"; cc->debug_excp_handler = arm_debug_excp_handler; } diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 7d27c69..8059d8a 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -689,6 +689,8 @@ static inline void pstate_write(CPUARMState *env, uint32_t val) /* Return the current CPSR value. */ uint32_t cpsr_read(CPUARMState *env); +/* Return the current SCR value. */ +uint32_t scr_read(CPUARMState *env); /* Set the CPSR. Note that some bits of mask must be all-set or all-clear. */ void cpsr_write(CPUARMState *env, uint32_t val, uint32_t mask); diff --git a/target-arm/gdbstub.c b/target-arm/gdbstub.c index 1c34396..9fbe979 100644 --- a/target-arm/gdbstub.c +++ b/target-arm/gdbstub.c @@ -54,6 +54,9 @@ int arm_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n) case 25: /* CPSR */ return gdb_get_reg32(mem_buf, cpsr_read(env)); + case 26: + /* SCR */ + return gdb_get_reg32(mem_buf, scr_read(env)); } /* Unknown register. */ return 0; diff --git a/target-arm/helper.c b/target-arm/helper.c index 8d9563f..a721db1 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -2407,6 +2407,11 @@ static const ARMCPRegInfo v8_el2_cp_reginfo[] = { REGINFO_SENTINEL }; +uint32_t scr_read(CPUARMState *env) +{ + return env->cp15.scr_el3; +} + static void nsacr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) {