[RFC,05/11] gdbstub: add helper for 128 bit registers
diff mbox series

Message ID 20191115173000.21891-6-alex.bennee@linaro.org
State New
Headers show
Series
  • gdbstub re-factor and SVE support
Related show

Commit Message

Alex Bennée Nov. 15, 2019, 5:29 p.m. UTC
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 include/exec/gdbstub.h | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Richard Henderson Nov. 18, 2019, 8:13 a.m. UTC | #1
On 11/15/19 6:29 PM, Alex Bennée wrote:
> +static inline int gdb_get_reg128(uint8_t *mem_buf, uint64_t val_hi,
> +                                 uint64_t val_lo)
> +{
> +    stq_p(mem_buf, val_hi);
> +    stq_p(mem_buf + 8, val_lo);
> +    return 16;

Since stq_p itself depends on TARGET_WORDS_BIGENDIAN,
I think the word ordering here should as well.


r~

Patch
diff mbox series

diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
index 08363969c14..a898a2af990 100644
--- a/include/exec/gdbstub.h
+++ b/include/exec/gdbstub.h
@@ -102,6 +102,14 @@  static inline int gdb_get_reg64(uint8_t *mem_buf, uint64_t val)
     return 8;
 }
 
+static inline int gdb_get_reg128(uint8_t *mem_buf, uint64_t val_hi,
+                                 uint64_t val_lo)
+{
+    stq_p(mem_buf, val_hi);
+    stq_p(mem_buf + 8, val_lo);
+    return 16;
+}
+
 #if TARGET_LONG_BITS == 64
 #define gdb_get_regl(buf, val) gdb_get_reg64(buf, val)
 #define ldtul_p(addr) ldq_p(addr)