aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2025-04-17 10:18:35 +0200
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2025-04-25 17:09:58 +0200
commiteb3020b6ed2baca63c2a3fad012335670841ead6 (patch)
tree873c0cfeae9ea3a80d11be63164ccc818f796a39
parent1b079a6eebb879d14da193919afafc303e938427 (diff)
downloadqemu-eb3020b6ed2baca63c2a3fad012335670841ead6.zip
qemu-eb3020b6ed2baca63c2a3fad012335670841ead6.tar.gz
qemu-eb3020b6ed2baca63c2a3fad012335670841ead6.tar.bz2
hw/microblaze: Evaluate TARGET_BIG_ENDIAN at compile time
Rather than evaluating TARGET_BIG_ENDIAN at preprocessing time via #ifdef'ry, do it in C at compile time Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20250417131004.47205-8-philmd@linaro.org>
-rw-r--r--hw/microblaze/petalogix_ml605_mmu.c12
-rw-r--r--hw/microblaze/xlnx-zynqmp-pmu.c12
2 files changed, 12 insertions, 12 deletions
diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c
index c887c7a..bea6b68 100644
--- a/hw/microblaze/petalogix_ml605_mmu.c
+++ b/hw/microblaze/petalogix_ml605_mmu.c
@@ -218,12 +218,12 @@ petalogix_ml605_init(MachineState *machine)
static void petalogix_ml605_machine_init(MachineClass *mc)
{
-#if TARGET_BIG_ENDIAN
- mc->desc = "PetaLogix linux refdesign for xilinx ml605 (big endian)";
- mc->deprecation_reason = "big endian support is not tested";
-#else
- mc->desc = "PetaLogix linux refdesign for xilinx ml605 (little endian)";
-#endif
+ if (TARGET_BIG_ENDIAN) {
+ mc->desc = "PetaLogix linux refdesign for xilinx ml605 (big endian)";
+ mc->deprecation_reason = "big endian support is not tested";
+ } else {
+ mc->desc = "PetaLogix linux refdesign for xilinx ml605 (little endian)";
+ }
mc->init = petalogix_ml605_init;
}
diff --git a/hw/microblaze/xlnx-zynqmp-pmu.c b/hw/microblaze/xlnx-zynqmp-pmu.c
index ea1430f..ed40b5f 100644
--- a/hw/microblaze/xlnx-zynqmp-pmu.c
+++ b/hw/microblaze/xlnx-zynqmp-pmu.c
@@ -181,12 +181,12 @@ static void xlnx_zynqmp_pmu_init(MachineState *machine)
static void xlnx_zynqmp_pmu_machine_init(MachineClass *mc)
{
-#if TARGET_BIG_ENDIAN
- mc->desc = "Xilinx ZynqMP PMU machine (big endian)";
- mc->deprecation_reason = "big endian support is not tested";
-#else
- mc->desc = "Xilinx ZynqMP PMU machine (little endian)";
-#endif
+ if (TARGET_BIG_ENDIAN) {
+ mc->desc = "Xilinx ZynqMP PMU machine (big endian)";
+ mc->deprecation_reason = "big endian support is not tested";
+ } else {
+ mc->desc = "Xilinx ZynqMP PMU machine (little endian)";
+ }
mc->init = xlnx_zynqmp_pmu_init;
}