exec/tswap: target code can use TARGET_BIG_ENDIAN instead of target_words_bigendian()

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20250317183417.285700-2-pierrick.bouvier@linaro.org>
This commit is contained in:
Pierrick Bouvier 2025-03-17 11:34:00 -07:00 committed by Richard Henderson
parent 91d0d16b44
commit cfac5cdff5
2 changed files with 7 additions and 5 deletions

View file

@ -155,6 +155,7 @@ void cpu_abort(CPUState *cpu, const char *fmt, ...)
abort();
}
#undef target_words_bigendian
bool target_words_bigendian(void)
{
return TARGET_BIG_ENDIAN;

View file

@ -13,13 +13,14 @@
/**
* target_words_bigendian:
* Returns true if the (default) endianness of the target is big endian,
* false otherwise. Note that in target-specific code, you can use
* TARGET_BIG_ENDIAN directly instead. On the other hand, common
* code should normally never need to know about the endianness of the
* target, so please do *not* use this function unless you know very well
* what you are doing!
* false otherwise. Common code should normally never need to know about the
* endianness of the target, so please do *not* use this function unless you
* know very well what you are doing!
*/
bool target_words_bigendian(void);
#ifdef COMPILING_PER_TARGET
#define target_words_bigendian() TARGET_BIG_ENDIAN
#endif
/*
* If we're in target-specific code, we can hard-code the swapping