[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/20] target/sparc: Implement CPUClass::datapath_is_big_endian
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 06/20] target/sparc: Implement CPUClass::datapath_is_big_endian |
Date: |
Wed, 4 Dec 2024 21:25:48 +0100 |
While the SPARC data endianness can be changed at runtime,
we do not implement that; only big endianness is used.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/sparc/cpu.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c
index dd7af86de73..de0386dbf64 100644
--- a/target/sparc/cpu.c
+++ b/target/sparc/cpu.c
@@ -688,6 +688,20 @@ static void sparc_cpu_dump_state(CPUState *cs, FILE *f,
int flags)
qemu_fprintf(f, "\n");
}
+static bool sparc_cpu_datapath_is_big_endian(CPUState *cs)
+{
+#if defined(TARGET_SPARC64)
+ /*
+ * SPARCv9 has a couple of PSTATE bits that set the endianness:
+ * Current Little Endian (PS_CLE) and Trap Little Endian (PS_TLE).
+ * We don't implement that yet.
+ */
+ return true;
+#else
+ return true;
+#endif
+}
+
static void sparc_cpu_set_pc(CPUState *cs, vaddr value)
{
SPARCCPU *cpu = SPARC_CPU(cs);
@@ -958,6 +972,7 @@ static void sparc_cpu_class_init(ObjectClass *oc, void
*data)
cc->class_by_name = sparc_cpu_class_by_name;
cc->parse_features = sparc_cpu_parse_features;
+ cc->datapath_is_big_endian = sparc_cpu_datapath_is_big_endian;
cc->has_work = sparc_cpu_has_work;
cc->mmu_index = sparc_cpu_mmu_index;
cc->dump_state = sparc_cpu_dump_state;
--
2.45.2
- [PATCH 00/20] target: Implement CPUClass::datapath_is_big_endian() handlers, Philippe Mathieu-Daudé, 2024/12/04
- [PATCH 01/20] exec/tswap: Rename target_words_bigendian -> qemu_binary_is_bigendian, Philippe Mathieu-Daudé, 2024/12/04
- [PATCH 02/20] hw/core/cpu: Introduce CPUClass::datapath_is_big_endian() handler, Philippe Mathieu-Daudé, 2024/12/04
- [PATCH 03/20] target/arm: Implement CPUClass::datapath_is_big_endian, Philippe Mathieu-Daudé, 2024/12/04
- [PATCH 04/20] target/ppc: Register CPUClass::datapath_is_big_endian, Philippe Mathieu-Daudé, 2024/12/04
- [PATCH 05/20] target/rx: Implement CPUClass::datapath_is_big_endian, Philippe Mathieu-Daudé, 2024/12/04
- [PATCH 06/20] target/sparc: Implement CPUClass::datapath_is_big_endian,
Philippe Mathieu-Daudé <=
- [PATCH 07/20] target/riscv: Implement CPUClass::datapath_is_big_endian, Philippe Mathieu-Daudé, 2024/12/04
- [PATCH 08/20] target/sh4: Expose CPUSH4State::little_endian property, Philippe Mathieu-Daudé, 2024/12/04
- [PATCH 10/20] target/microblaze: Implement CPUClass::datapath_is_big_endian, Philippe Mathieu-Daudé, 2024/12/04
- [PATCH 09/20] target/sh4: Implement CPUClass::datapath_is_big_endian, Philippe Mathieu-Daudé, 2024/12/04
- [PATCH 11/20] target/mips: Implement CPUClass::datapath_is_big_endian, Philippe Mathieu-Daudé, 2024/12/04
- [PATCH 12/20] target/xtensa: Implement xtensa_isa_is_big_endian(), Philippe Mathieu-Daudé, 2024/12/04
- [PATCH 13/20] target/xtensa: Implement CPUClass::datapath_is_big_endian, Philippe Mathieu-Daudé, 2024/12/04
- [PATCH 14/20] target: Implement CPUClass::datapath_is_big_endian (little-endian), Philippe Mathieu-Daudé, 2024/12/04
- [PATCH 15/20] target: Implement CPUClass::datapath_is_big_endian (big-endian), Philippe Mathieu-Daudé, 2024/12/04