[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/20] target/microblaze: Implement CPUClass::datapath_is_big_end
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 10/20] target/microblaze: Implement CPUClass::datapath_is_big_endian |
Date: |
Wed, 4 Dec 2024 21:25:52 +0100 |
Implement the MicroBlaze datapath_is_big_endian() handler,
returning the value of the ENDI bit.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/microblaze/cpu.h | 2 ++
target/microblaze/cpu.c | 11 +++++++++++
2 files changed, 13 insertions(+)
diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h
index 3e5a3e5c605..dd6b61b34ba 100644
--- a/target/microblaze/cpu.h
+++ b/target/microblaze/cpu.h
@@ -412,6 +412,8 @@ void mb_tcg_init(void);
/* Ensure there is no overlap between the two masks. */
QEMU_BUILD_BUG_ON(MSR_TB_MASK & IFLAGS_TB_MASK);
+bool mb_cpu_datapath_is_big_endian(CPUState *cs);
+
static inline void cpu_get_tb_cpu_state(CPUMBState *env, vaddr *pc,
uint64_t *cs_base, uint32_t *flags)
{
diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c
index 710eb1146c1..3a0e5713415 100644
--- a/target/microblaze/cpu.c
+++ b/target/microblaze/cpu.c
@@ -26,6 +26,7 @@
#include "qapi/error.h"
#include "cpu.h"
#include "qemu/module.h"
+#include "sysemu/hw_accel.h"
#include "hw/qdev-properties.h"
#include "exec/exec-all.h"
#include "exec/cpu_ldst.h"
@@ -119,6 +120,15 @@ static bool mb_cpu_has_work(CPUState *cs)
return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI);
}
+bool mb_cpu_datapath_is_big_endian(CPUState *cs)
+{
+ MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs);
+
+ cpu_synchronize_state(cs);
+
+ return !cpu->cfg.endi;
+}
+
static int mb_cpu_mmu_index(CPUState *cs, bool ifetch)
{
CPUMBState *env = cpu_env(cs);
@@ -447,6 +457,7 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data)
&mcc->parent_phases);
cc->class_by_name = mb_cpu_class_by_name;
+ cc->datapath_is_big_endian = mb_cpu_datapath_is_big_endian;
cc->has_work = mb_cpu_has_work;
cc->mmu_index = mb_cpu_mmu_index;
cc->dump_state = mb_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é, 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é <=
- [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
- [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