]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target-info: add target_base_ppc, target_ppc and target_ppc64
authorPierrick Bouvier <pierrick.bouvier@linaro.org>
Sat, 31 Jan 2026 02:00:55 +0000 (18:00 -0800)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 3 Feb 2026 13:57:33 +0000 (14:57 +0100)
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20260131020100.1115203-2-pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
include/qemu/target-info.h
target-info.c

index 62359622232313cac2fdf9f3c2e19e27872695bb..e328733430405d335c43486e3bee7c70b3723dcc 100644 (file)
@@ -71,4 +71,25 @@ bool target_arm(void);
  */
 bool target_aarch64(void);
 
+/**
+ * target_base_ppc:
+ *
+ * Returns whether the target architecture is PowerPC 32-bit or 64-bit.
+ */
+bool target_base_ppc(void);
+
+/**
+ * target_ppc:
+ *
+ * Returns whether the target architecture is PowerPC 32-bit.
+ */
+bool target_ppc(void);
+
+/**
+ * target_ppc64:
+ *
+ * Returns whether the target architecture is PowerPC 64-bit.
+ */
+bool target_ppc64(void);
+
 #endif
index 24696ff41116fc2b46ed04410f9305186dee8698..5a6d72825242019dba4994ebe90750e95de71bac 100644 (file)
@@ -73,3 +73,24 @@ bool target_aarch64(void)
 {
     return target_arch() == SYS_EMU_TARGET_AARCH64;
 }
+
+bool target_base_ppc(void)
+{
+    switch (target_arch()) {
+    case SYS_EMU_TARGET_PPC:
+    case SYS_EMU_TARGET_PPC64:
+        return true;
+    default:
+        return false;
+    }
+}
+
+bool target_ppc(void)
+{
+    return target_arch() == SYS_EMU_TARGET_PPC;
+}
+
+bool target_ppc64(void)
+{
+    return target_arch() == SYS_EMU_TARGET_PPC64;
+}