Call TargetInfo::target_aarch64() at runtime, allowing to
remove the target-specific TARGET_AARCH64 definition and
build cpu-max.c once as common object.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <
20260526203722.79463-18-philmd@linaro.org>
#include "qemu/osdep.h"
#include "qemu/units.h"
+#include "qemu/target-info.h"
#include "system/hw_accel.h"
#include "system/kvm.h"
#include "system/qtest.h"
static void cpu_max_initfn(Object *obj)
{
ARMCPU *cpu = ARM_CPU(obj);
-
-#ifdef TARGET_AARCH64
- const bool aarch64_enabled = true;
-#else
- const bool aarch64_enabled = false;
-#endif /* !TARGET_AARCH64 */
+ const bool aarch64_enabled = target_aarch64();
if (hwaccel_enabled()) {
assert(aarch64_enabled);
arm_common_system_ss.add(files('gdbstub.c'))
arm_user_ss.add(files('gdbstub.c'))
-arm_ss.add(files('cpu-max.c'))
arm_ss.add(when: 'TARGET_AARCH64', if_true: files(
'cpu64.c',
))
arm_common_user_system_ss.add(files(
'cpregs-gcs.c',
'cpregs-pmu.c',
+ 'cpu-max.c',
'debug_helper.c',
'helper.c',
'vfp_fpscr.c',