mirror of
https://github.com/qemu/qemu.git
synced 2026-02-04 02:24:51 +00:00
qemu/target_info: Add target_base_arm() helper
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>
This commit is contained in:
@@ -50,6 +50,13 @@ const char *target_cpu_type(void);
|
|||||||
*/
|
*/
|
||||||
bool target_big_endian(void);
|
bool target_big_endian(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* target_base_arm:
|
||||||
|
*
|
||||||
|
* Returns whether the target architecture is ARM or Aarch64.
|
||||||
|
*/
|
||||||
|
bool target_base_arm(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* target_arm:
|
* target_arm:
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -53,6 +53,17 @@ bool target_big_endian(void)
|
|||||||
return target_endian_mode() == ENDIAN_MODE_BIG;
|
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)
|
bool target_arm(void)
|
||||||
{
|
{
|
||||||
return target_arch() == SYS_EMU_TARGET_ARM;
|
return target_arch() == SYS_EMU_TARGET_ARM;
|
||||||
|
|||||||
Reference in New Issue
Block a user