[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 14/20] target: Implement CPUClass::datapath_is_big_endian (little
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 14/20] target: Implement CPUClass::datapath_is_big_endian (little-endian) |
Date: |
Wed, 4 Dec 2024 21:25:56 +0100 |
For all targets which have endianness architecturally
predefined as little endian (built using TARGET_BIG_ENDIAN=n),
their datapath_is_big_endian() handler simply returns %false.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/alpha/cpu.c | 6 ++++++
target/avr/cpu.c | 7 ++++++-
target/i386/cpu.c | 6 ++++++
target/loongarch/cpu.c | 6 ++++++
target/tricore/cpu.c | 6 ++++++
5 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c
index 5d75c941f7a..ee844a4c455 100644
--- a/target/alpha/cpu.c
+++ b/target/alpha/cpu.c
@@ -27,6 +27,11 @@
#include "fpu/softfloat.h"
+static bool alpha_cpu_datapath_is_big_endian(CPUState *cs)
+{
+ return false;
+}
+
static void alpha_cpu_set_pc(CPUState *cs, vaddr value)
{
CPUAlphaState *env = cpu_env(cs);
@@ -247,6 +252,7 @@ static void alpha_cpu_class_init(ObjectClass *oc, void
*data)
&acc->parent_realize);
cc->class_by_name = alpha_cpu_class_by_name;
+ cc->datapath_is_big_endian = alpha_cpu_datapath_is_big_endian;
cc->has_work = alpha_cpu_has_work;
cc->mmu_index = alpha_cpu_mmu_index;
cc->dump_state = alpha_cpu_dump_state;
diff --git a/target/avr/cpu.c b/target/avr/cpu.c
index 3132842d565..f32f1bee61f 100644
--- a/target/avr/cpu.c
+++ b/target/avr/cpu.c
@@ -159,6 +159,11 @@ static ObjectClass *avr_cpu_class_by_name(const char
*cpu_model)
return object_class_by_name(cpu_model);
}
+static bool avr_cpu_datapath_is_big_endian(CPUState *cs)
+{
+ return false;
+}
+
static void avr_cpu_dump_state(CPUState *cs, FILE *f, int flags)
{
CPUAVRState *env = cpu_env(cs);
@@ -230,7 +235,7 @@ static void avr_cpu_class_init(ObjectClass *oc, void *data)
&mcc->parent_phases);
cc->class_by_name = avr_cpu_class_by_name;
-
+ cc->datapath_is_big_endian = avr_cpu_datapath_is_big_endian;
cc->has_work = avr_cpu_has_work;
cc->mmu_index = avr_cpu_mmu_index;
cc->dump_state = avr_cpu_dump_state;
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 3725dbbc4b3..f783d311579 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -2008,6 +2008,11 @@ static char *x86_cpu_class_get_model_name(X86CPUClass
*cc)
return cpu_model_from_type(class_name);
}
+static bool x86_cpu_datapath_is_big_endian(CPUState *cs)
+{
+ return false;
+}
+
typedef struct X86CPUVersionDefinition {
X86CPUVersion version;
const char *alias;
@@ -8588,6 +8593,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc,
void *data)
cc->class_by_name = x86_cpu_class_by_name;
cc->parse_features = x86_cpu_parse_featurestr;
+ cc->datapath_is_big_endian = x86_cpu_datapath_is_big_endian;
cc->has_work = x86_cpu_has_work;
cc->mmu_index = x86_cpu_mmu_index;
cc->dump_state = x86_cpu_dump_state;
diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c
index 57cc4f314bf..b9cf0091546 100644
--- a/target/loongarch/cpu.c
+++ b/target/loongarch/cpu.c
@@ -742,6 +742,11 @@ static ObjectClass *loongarch_cpu_class_by_name(const char
*cpu_model)
return oc;
}
+static bool loongarch_cpu_datapath_is_big_endian(CPUState *cs)
+{
+ return false;
+}
+
void loongarch_cpu_dump_state(CPUState *cs, FILE *f, int flags)
{
CPULoongArchState *env = cpu_env(cs);
@@ -836,6 +841,7 @@ static void loongarch_cpu_class_init(ObjectClass *c, void
*data)
&lacc->parent_phases);
cc->class_by_name = loongarch_cpu_class_by_name;
+ cc->datapath_is_big_endian = loongarch_cpu_datapath_is_big_endian;
cc->has_work = loongarch_cpu_has_work;
cc->mmu_index = loongarch_cpu_mmu_index;
cc->dump_state = loongarch_cpu_dump_state;
diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c
index 1a261715907..ba53d83f662 100644
--- a/target/tricore/cpu.c
+++ b/target/tricore/cpu.c
@@ -29,6 +29,11 @@ static inline void set_feature(CPUTriCoreState *env, int
feature)
env->features |= 1ULL << feature;
}
+static bool tricore_cpu_datapath_is_big_endian(CPUState *cs)
+{
+ return false;
+}
+
static const gchar *tricore_gdb_arch_name(CPUState *cs)
{
return "tricore";
@@ -191,6 +196,7 @@ static void tricore_cpu_class_init(ObjectClass *c, void
*data)
resettable_class_set_parent_phases(rc, NULL, tricore_cpu_reset_hold, NULL,
&mcc->parent_phases);
cc->class_by_name = tricore_cpu_class_by_name;
+ cc->datapath_is_big_endian = tricore_cpu_datapath_is_big_endian;
cc->has_work = tricore_cpu_has_work;
cc->mmu_index = tricore_cpu_mmu_index;
--
2.45.2
- [PATCH 04/20] target/ppc: Register 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é, 2024/12/04
- [PATCH 14/20] target: Implement CPUClass::datapath_is_big_endian (little-endian),
Philippe Mathieu-Daudé <=
- [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
- [PATCH 20/20] hw/core/cpu: Remove cpu_virtio_is_big_endian(), Philippe Mathieu-Daudé, 2024/12/04