[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 01/17] exec/tswap: target code can use TARGET_BIG_ENDIAN inste
From: |
Pierrick Bouvier |
Subject: |
[PATCH v5 01/17] exec/tswap: target code can use TARGET_BIG_ENDIAN instead of target_words_bigendian() |
Date: |
Fri, 14 Mar 2025 10:31:23 -0700 |
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
include/exec/tswap.h | 11 ++++++-----
cpu-target.c | 1 +
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/include/exec/tswap.h b/include/exec/tswap.h
index ecd4faef015..2683da0adb7 100644
--- a/include/exec/tswap.h
+++ b/include/exec/tswap.h
@@ -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
diff --git a/cpu-target.c b/cpu-target.c
index cae77374b38..519b0f89005 100644
--- a/cpu-target.c
+++ b/cpu-target.c
@@ -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;
--
2.39.5
- [PATCH v5 00/17] make system memory API available for common code, Pierrick Bouvier, 2025/03/14
- [PATCH v5 03/17] exec/memory_ldst: extract memory_ldst declarations from cpu-all.h, Pierrick Bouvier, 2025/03/14
- [PATCH v5 01/17] exec/tswap: target code can use TARGET_BIG_ENDIAN instead of target_words_bigendian(),
Pierrick Bouvier <=
- [PATCH v5 04/17] exec/memory_ldst_phys: extract memory_ldst_phys declarations from cpu-all.h, Pierrick Bouvier, 2025/03/14
- [PATCH v5 02/17] exec/tswap: implement {ld, st}.*_p as functions instead of macros, Pierrick Bouvier, 2025/03/14
- [PATCH v5 05/17] exec/memory.h: make devend_memop "target defines" agnostic, Pierrick Bouvier, 2025/03/14
- [PATCH v5 06/17] codebase: prepare to remove cpu.h from exec/exec-all.h, Pierrick Bouvier, 2025/03/14
- [PATCH v5 07/17] exec/exec-all: remove dependency on cpu.h, Pierrick Bouvier, 2025/03/14
- [PATCH v5 08/17] exec/memory-internal: remove dependency on cpu.h, Pierrick Bouvier, 2025/03/14
- [PATCH v5 13/17] system/physmem: compilation unit is now common to all targets, Pierrick Bouvier, 2025/03/14
- [PATCH v5 11/17] exec/ram_addr: call xen_hvm_modified_memory only if xen is enabled, Pierrick Bouvier, 2025/03/14