[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 10/28] gdbstub: add helper for 128 bit registers
From: |
Alex Bennée |
Subject: |
[PATCH v1 10/28] gdbstub: add helper for 128 bit registers |
Date: |
Mon, 16 Mar 2020 17:21:37 +0000 |
Signed-off-by: Alex Bennée <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
---
v2
- take care of endianess of the whole 128 bit word
---
include/exec/gdbstub.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
index 08363969c14..59e366ba3af 100644
--- a/include/exec/gdbstub.h
+++ b/include/exec/gdbstub.h
@@ -102,6 +102,19 @@ 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)
+{
+#ifdef TARGET_WORDS_BIGENDIAN
+ stq_p(mem_buf, val_hi);
+ stq_p(mem_buf + 8, val_lo);
+#else
+ stq_p(mem_buf, val_lo);
+ stq_p(mem_buf + 8, val_hi);
+#endif
+ 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)
--
2.20.1
- [PATCH v1 00/28 for 5.0] testing and gdbstub, Alex Bennée, 2020/03/16
- [PATCH v1 04/28] tests/docker: Update VirGL to v0.8.0, Alex Bennée, 2020/03/16
- [PATCH v1 03/28] tests/docker: Remove obsolete VirGL --with-glx configure option, Alex Bennée, 2020/03/16
- [PATCH v1 01/28] tests/docker: Install tools to cross-debug and build Linux kernels, Alex Bennée, 2020/03/16
- [PATCH v1 06/28] gdbstub: make GDBState static and have common init function, Alex Bennée, 2020/03/16
- [PATCH v1 02/28] tests/docker: Update VirGL git repository URL, Alex Bennée, 2020/03/16
- [PATCH v1 10/28] gdbstub: add helper for 128 bit registers,
Alex Bennée <=
- [PATCH v1 08/28] gdbstub: move str_buf to GDBState and use GString, Alex Bennée, 2020/03/16
- [PATCH v1 05/28] travis.yml: Set G_MESSAGES_DEBUG do report GLib errors, Alex Bennée, 2020/03/16
- [PATCH v1 27/28] gdbstub: do not split gdb_monitor_write payload, Alex Bennée, 2020/03/16
- [PATCH v1 11/28] target/arm: use gdb_get_reg helpers, Alex Bennée, 2020/03/16
- [PATCH v1 09/28] gdbstub: move mem_buf to GDBState and use GByteArray, Alex Bennée, 2020/03/16
- [PATCH v1 12/28] target/m68k: use gdb_get_reg helpers, Alex Bennée, 2020/03/16
- [PATCH v1 07/28] gdbstub: stop passing GDBState * around and use global, Alex Bennée, 2020/03/16
- [PATCH v1 13/28] target/i386: use gdb_get_reg helpers, Alex Bennée, 2020/03/16