Add a helper to check whether the target base architecture
is ARM (either 32-bit or 64-bit).
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <
20251021210144.58108-3-philmd@linaro.org>
*/
bool target_big_endian(void);
+/**
+ * target_base_arm:
+ *
+ * Returns whether the target architecture is ARM or Aarch64.
+ */
+bool target_base_arm(void);
+
/**
* target_arm:
*
return target_endian_mode() == ENDIAN_MODE_BIG;
}
+bool target_base_arm(void)
+{
+ switch (target_arch()) {
+ case SYS_EMU_TARGET_ARM:
+ case SYS_EMU_TARGET_AARCH64:
+ return true;
+ default:
+ return false;
+ }
+}
+
bool target_arm(void)
{
return target_arch() == SYS_EMU_TARGET_ARM;