@@ -10,17 +10,6 @@
#include "qemu/bswap.h"
-/**
- * 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!
- */
-bool target_words_bigendian(void);
-
/*
* If we're in target-specific code, we can hard-code the swapping
* condition, otherwise we have to do (slower) run-time checks.
@@ -1,6 +1,8 @@
#ifndef BSWAP_H
#define BSWAP_H
+#include <stdbool.h>
+
#undef bswap16
#define bswap16(_x) __builtin_bswap16(_x)
#undef bswap32
@@ -8,6 +10,16 @@
#undef bswap64
#define bswap64(_x) __builtin_bswap64(_x)
+/**
+ * target_words_bigendian:
+ * Returns true if the (default) endianness of the target is big endian,
+ * 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);
+
static inline uint32_t bswap24(uint32_t x)
{
return (((x & 0x000000ffU) << 16) |
This is needed for next commits (especially when implementing st/ld primitives which will use this function). As well, remove reference to TARGET_BIG_ENDIAN, as we are about to remove this dependency. Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> --- include/exec/tswap.h | 11 ----------- include/qemu/bswap.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-)