[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 13/20] target/xtensa: Implement CPUClass::datapath_is_big_endian
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 13/20] target/xtensa: Implement CPUClass::datapath_is_big_endian |
Date: |
Wed, 4 Dec 2024 21:25:55 +0100 |
Implement Xtensa datapath_is_big_endian() helper via libisa.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
Other accesses to xtensa_isa_internal fields don't
call cpu_synchronize_state(), and the libisa doesn't
provide a way to switch endianness from translation
code. Should we add a sync just in case?
---
target/xtensa/cpu.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c
index 6f9039abaee..7bf792fd0f4 100644
--- a/target/xtensa/cpu.c
+++ b/target/xtensa/cpu.c
@@ -40,6 +40,13 @@
#endif
+static bool xtensa_cpu_datapath_is_big_endian(CPUState *cs)
+{
+ CPUXtensaState *env = cpu_env(cs);
+
+ return xtensa_isa_is_big_endian(env->config->isa);
+}
+
static void xtensa_cpu_set_pc(CPUState *cs, vaddr value)
{
XtensaCPU *cpu = XTENSA_CPU(cs);
@@ -256,6 +263,7 @@ static void xtensa_cpu_class_init(ObjectClass *oc, void
*data)
&xcc->parent_phases);
cc->class_by_name = xtensa_cpu_class_by_name;
+ cc->datapath_is_big_endian = xtensa_cpu_datapath_is_big_endian;
cc->has_work = xtensa_cpu_has_work;
cc->mmu_index = xtensa_cpu_mmu_index;
cc->dump_state = xtensa_cpu_dump_state;
--
2.45.2
- Re: [PATCH 03/20] target/arm: Implement CPUClass::datapath_is_big_endian, (continued)
- [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é, 2024/12/04
- [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é <=
- [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
- [PATCH 16/20] hw/core/cpu: Expose cpu_datapath_is_big_endian() method, Philippe Mathieu-Daudé, 2024/12/04
- [PATCH 17/20] disas: Use cpu_datapath_is_big_endian(), Philippe Mathieu-Daudé, 2024/12/04
- [PATCH 18/20] hw/core/generic-loader: Use cpu_datapath_is_big_endian(), Philippe Mathieu-Daudé, 2024/12/04
- [RFC PATCH 19/20] hw/virtio: Use cpu_datapath_is_big_endian(), Philippe Mathieu-Daudé, 2024/12/04