diff mbox series

[09/20] target/sh4: Implement CPUClass::datapath_is_big_endian

Message ID 20241204202602.58083-10-philmd@linaro.org
State New
Headers show
Series target: Implement CPUClass::datapath_is_big_endian() handlers | expand

Commit Message

Philippe Mathieu-Daudé Dec. 4, 2024, 8:25 p.m. UTC
Implement SH4 datapath_is_big_endian() helper, returning
the 'little_endian' property set at reset.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/sh4/cpu.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c
index f54005644c9..69108c1676e 100644
--- a/target/sh4/cpu.c
+++ b/target/sh4/cpu.c
@@ -29,6 +29,13 @@ 
 #include "fpu/softfloat-helpers.h"
 #include "tcg/tcg.h"
 
+static bool superh_cpu_datapath_is_big_endian(CPUState *cs)
+{
+    SuperHCPU *cpu = SUPERH_CPU(cs);
+
+    return !cpu->env.little_endian;
+}
+
 static void superh_cpu_set_pc(CPUState *cs, vaddr value)
 {
     SuperHCPU *cpu = SUPERH_CPU(cs);
@@ -283,6 +290,7 @@  static void superh_cpu_class_init(ObjectClass *oc, void *data)
                                        &scc->parent_phases);
 
     cc->class_by_name = superh_cpu_class_by_name;
+    cc->datapath_is_big_endian = superh_cpu_datapath_is_big_endian;
     cc->has_work = superh_cpu_has_work;
     cc->mmu_index = sh4_cpu_mmu_index;
     cc->dump_state = superh_cpu_dump_state;