gdbstub: Introduce ldtul_$endian_p() helpers
v3 cover gdbstub: Introduce ldtul_$endian_p() helpers
Only unreviewed patches from v2:
https://lore.kernel.org/qemu-devel/[email protected]/
Philippe Mathieu-Daudé (2):
exec/tswap: Massage target_needs_bswap() definition gdbstub/helpers: Introduce ldtul_$endian_p() helpers
include/exec/tswap.h | 2 +- include/gdbstub/helpers.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-)
Signature · 1 line
2.45.2
PATCH v3 1/2 exec/tswap: Massage target_needs_bswap() definition
Invert target_needs_bswap() comparison to match the COMPILING_PER_TARGET definition (2 lines upper).
Message-Id: <[email protected]>
--- include/exec/tswap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/exec/tswap.h +1 -1
@@ -28,7 +28,7 @@ bool target_words_bigendian(void);#ifdef COMPILING_PER_TARGET #define target_needs_bswap () (HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN)#else -#define target_needs_bswap () (target_words_bigendian() != HOST_BIG_ENDIAN) +#define target_needs_bswap () (HOST_BIG_ENDIAN != target_words_bigendian())#endif /* COMPILING_PER_TARGET */ static inline uint16_t tswap16 (uint16_t s)
Signature · 1 line
2.45.2
Re: [PATCH v3 1/2] exec/tswap: Massage target_needs_bswap() definition
Quoted 8 lines · Philippe Mathieu-Daudé
Invert
target_needs_bswap()comparison to match theCOMPILING_PER_TARGETdefinition (2 lines upper).Signed-off-by Philippe Mathieu-Daudé <[email protected]>Message-Id: <[email protected]>
--- include/exec/tswap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
r~
Quoted 14 lines
include/exec/tswap.h +1
-1@@ -28,7 +28,7 @@ bool target_words_bigendian(void);#ifdef COMPILING_PER_TARGET #define target_needs_bswap () (HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN)#else -#define target_needs_bswap () (target_words_bigendian() != HOST_BIG_ENDIAN) +#define target_needs_bswap () (HOST_BIG_ENDIAN != target_words_bigendian())#endif /* COMPILING_PER_TARGET */ static inline uint16_t tswap16 (uint16_t s)
PATCH v3 2/2 gdbstub/helpers: Introduce ldtul_$endian_p() helpers
In reply to Philippe Mathieu-DaudéIntroduce ldtul_le_p() and ldtul_be_p() to use directly in place of ldtul_p() when a target endianness is fixed.
--- include/gdbstub/helpers.h | 4 ++++ 1 file changed, 4 insertions(+)
include/gdbstub/helpers.h +4 -0
@@ -95,9 +95,13 @@ static inline uint8_t *gdb_get_reg_ptr(GByteArray *buf, int len)#if TARGET_LONG_BITS ==64 #define gdb_get_regl (buf, val) gdb_get_reg64(buf, val)#define ldtul_p (addr) ldq_p(addr) +#define ldtul_le_p (addr) ldq_le_p(addr) +#define ldtul_be_p (addr) ldq_be_p(addr)#else #define gdb_get_regl (buf, val) gdb_get_reg32(buf, val)#define ldtul_p (addr) ldl_p(addr) +#define ldtul_le_p (addr) ldl_le_p(addr) +#define ldtul_be_p (addr) ldl_be_p(addr)#endif #endif /* _GDBSTUB_HELPERS_H_ */
Signature · 1 line
2.45.2
Re: [PATCH v3 2/2] gdbstub/helpers: Introduce ldtul_$endian_p() helpers
Quoted 4 lines · Philippe Mathieu-Daudé
Introduce
ldtul_le_p()andldtul_be_p()to use directly in place ofldtul_p()when a target endianness is fixed.Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Signature · 2 lines
Alex Bennée Virtualisation Tech Lead @ Linaro
Re: [PATCH v3 2/2] gdbstub/helpers: Introduce ldtul_$endian_p() helpers
In reply to Philippe Mathieu-DaudéQuoted 7 lines · Philippe Mathieu-Daudé
Introduce
ldtul_le_p()andldtul_be_p()to use directly in place ofldtul_p()when a target endianness is fixed.Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- include/gdbstub/helpers.h | 4 ++++ 1 file changed, 4 insertions(+)
r~
Quoted 11 lines · Philippe Mathieu-Daudé
Only unreviewed patches from v2:
https://lore.kernel.org/qemu-devel/[email protected]/Philippe Mathieu-Daudé (2):
exec/tswap: Massagetarget_needs_bswap()definition gdbstub/helpers: Introduce ldtul_$endian_p() helpersinclude/exec/tswap.h | 2 +- include/gdbstub/helpers.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-)
For the series:
Quoted 6 lines · Philippe Mathieu-Daudé
Only unreviewed patches from v2:
https://lore.kernel.org/qemu-devel/[email protected]/Philippe Mathieu-Daudé (2):
exec/tswap: Massagetarget_needs_bswap()definition gdbstub/helpers: Introduce ldtul_$endian_p() helpers
Series queued.