From: Philippe Mathieu-Daudé Date: Thu, 17 Apr 2025 08:18:35 +0000 (+0200) Subject: hw/microblaze: Evaluate TARGET_BIG_ENDIAN at compile time X-Git-Tag: v10.1.0-rc0~113^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb3020b6ed2baca63c2a3fad012335670841ead6;p=thirdparty%2Fqemu.git 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é Reviewed-by: Richard Henderson Message-Id: <20250417131004.47205-8-philmd@linaro.org> --- diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c index c887c7a99ed..bea6b689fd1 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 ea1430f4081..ed40b5f2e05 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; }