qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: damien.hedde@greensocs.com,
	"Peter Maydell" <peter.maydell@linaro.org>,
	luis.machado@linaro.org,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"open list:ARM TCG CPUs" <qemu-arm@nongnu.org>,
	alan.hayward@arm.com, "Alex Bennée" <alex.bennee@linaro.org>
Subject: [PATCH  v4 06/21] target/arm: use gdb_get_reg helpers
Date: Fri, 20 Dec 2019 12:04:23 +0000	[thread overview]
Message-ID: <20191220120438.16114-7-alex.bennee@linaro.org> (raw)
In-Reply-To: <20191220120438.16114-1-alex.bennee@linaro.org>

This is cleaner than poking memory directly and will make later
clean-ups easier.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

---
v2
  - make sure we pass hi/lo correctly as quads are stored in LE order
---
 target/arm/helper.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/target/arm/helper.c b/target/arm/helper.c
index 5074b5f69ca..6f3b6ca7d3f 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -105,21 +105,17 @@ static int aarch64_fpu_gdb_get_reg(CPUARMState *env, uint8_t *buf, int reg)
 {
     switch (reg) {
     case 0 ... 31:
-        /* 128 bit FP register */
-        {
-            uint64_t *q = aa64_vfp_qreg(env, reg);
-            stq_le_p(buf, q[0]);
-            stq_le_p(buf + 8, q[1]);
-            return 16;
-        }
+    {
+        /* 128 bit FP register - quads are in LE order */
+        uint64_t *q = aa64_vfp_qreg(env, reg);
+        return gdb_get_reg128(buf, q[1], q[0]);
+    }
     case 32:
         /* FPSR */
-        stl_p(buf, vfp_get_fpsr(env));
-        return 4;
+        return gdb_get_reg32(buf, vfp_get_fpsr(env));
     case 33:
         /* FPCR */
-        stl_p(buf, vfp_get_fpcr(env));
-        return 4;
+        return gdb_get_reg32(buf,vfp_get_fpcr(env));
     default:
         return 0;
     }
-- 
2.20.1



  parent reply	other threads:[~2019-12-20 12:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-20 12:04 [PATCH v4 00/21] gdbstub refactor and SVE support (+check-tcg tweaks) Alex Bennée
2019-12-20 12:04 ` [PATCH v4 01/21] gdbstub: make GDBState static and have common init function Alex Bennée
2019-12-20 12:04 ` [PATCH v4 02/21] gdbstub: stop passing GDBState * around and use global Alex Bennée
2019-12-20 12:04 ` [PATCH v4 03/21] gdbstub: move str_buf to GDBState and use GString Alex Bennée
2019-12-20 12:04 ` [PATCH v4 04/21] gdbstub: move mem_buf to GDBState and use GByteArray Alex Bennée
2019-12-20 12:04 ` [PATCH v4 05/21] gdbstub: add helper for 128 bit registers Alex Bennée
2019-12-20 12:04 ` Alex Bennée [this message]
2019-12-20 12:04 ` [PATCH v4 07/21] target/m68k: use gdb_get_reg helpers Alex Bennée
2019-12-20 12:04 ` [PATCH v4 08/21] gdbstub: extend GByteArray to read register helpers Alex Bennée
2019-12-20 15:23   ` Damien Hedde
2019-12-20 12:04 ` [PATCH v4 09/21] target/arm: prepare for multiple dynamic XMLs Alex Bennée
2019-12-20 12:04 ` [PATCH v4 10/21] target/arm: explicitly encode regnum in our XML Alex Bennée
2019-12-20 12:04 ` [PATCH v4 11/21] target/arm: default SVE length to 64 bytes for linux-user Alex Bennée
2019-12-20 12:04 ` [PATCH v4 12/21] target/arm: generate xml description of our SVE registers Alex Bennée
2019-12-20 12:04 ` [PATCH v4 13/21] tests/tcg: add a configure compiler check for ARMv8.1 and SVE Alex Bennée
2019-12-20 12:04 ` [PATCH v4 14/21] target/arm: don't bother with id_aa64pfr0_read for USER_ONLY Alex Bennée
2019-12-20 12:04 ` [PATCH v4 15/21] tests/tcg/aarch64: userspace system register test Alex Bennée
2019-12-20 12:04 ` [PATCH v4 16/21] tests/guest-debug: add a simple test runner Alex Bennée
2019-12-20 12:04 ` [PATCH v4 17/21] tests/tcg/aarch64: add a gdbstub testcase for SVE registers Alex Bennée
2019-12-20 12:04 ` [PATCH v4 18/21] tests/tcg/aarch64: add SVE iotcl test Alex Bennée
2019-12-20 12:04 ` [PATCH v4 19/21] tests/tcg/aarch64: add test-sve-ioctl guest-debug test Alex Bennée
2019-12-20 12:04 ` [PATCH v4 20/21] gdbstub: change GDBState.last_packet to GByteArray Alex Bennée
2019-12-20 12:04 ` [PATCH v4 21/21] gdbstub: do not split gdb_monitor_write payload Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191220120438.16114-7-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=alan.hayward@arm.com \
    --cc=damien.hedde@greensocs.com \
    --cc=luis.machado@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).