Commit 4b75d19e36 for qemu.org
commit 4b75d19e362bf951b94c5f7738ff830fb6035fd7
Author: Philippe Mathieu-Daudé <philmd@linaro.org>
Date: Fri Feb 13 15:11:10 2026 +0100
qemu: Document qemu_arch_available() method
qemu_arch_available() is used to check if a broadly available
feature should be exposed to a particular set of target
architectures.
Since its argument is a mask of bits, rename it as @arch_bitmask.
We have less than 32 target architectures so far, so restrict it
to the uint32_t type.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20260213175032.32121-2-philmd@linaro.org>
diff --git a/include/system/arch_init.h b/include/system/arch_init.h
index f2f909d540..92d50ba8d6 100644
--- a/include/system/arch_init.h
+++ b/include/system/arch_init.h
@@ -25,6 +25,12 @@ enum {
QEMU_ARCH_LOONGARCH = (1 << 23),
};
-bool qemu_arch_available(unsigned qemu_arch_mask);
+/**
+ * qemu_arch_available:
+ * @arch_bitmask: bitmask of QEMU_ARCH_* constants
+ *
+ * Return whether the current target architecture is contained in @arch_bitmask
+ */
+bool qemu_arch_available(uint32_t arch_bitmask);
#endif
diff --git a/system/arch_init.c b/system/arch_init.c
index e85736884c..ec9e45a1a8 100644
--- a/system/arch_init.c
+++ b/system/arch_init.c
@@ -24,7 +24,7 @@
#include "qemu/osdep.h"
#include "system/arch_init.h"
-bool qemu_arch_available(unsigned qemu_arch_mask)
+bool qemu_arch_available(uint32_t arch_bitmask)
{
- return qemu_arch_mask & QEMU_ARCH;
+ return arch_bitmask & QEMU_ARCH;
}