[PATCH v4 1/5] qemu: Document qemu_arch_available() method

Philippe Mathieu-Daudé posted 5 patches 1 month, 3 weeks ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>
[PATCH v4 1/5] qemu: Document qemu_arch_available() method
Posted by Philippe Mathieu-Daudé 1 month, 3 weeks ago
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>
---
 include/system/arch_init.h | 8 +++++++-
 system/arch_init.c         | 4 ++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/include/system/arch_init.h b/include/system/arch_init.h
index f2f909d5406..92d50ba8d63 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 e85736884c9..d7ec6e69c79 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;
 }
-- 
2.52.0


Re: [PATCH v4 1/5] qemu: Document qemu_arch_available() method
Posted by Pierrick Bouvier 1 month, 3 weeks ago
On 2/13/26 9:50 AM, Philippe Mathieu-Daudé wrote:
> 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>
> ---
>   include/system/arch_init.h | 8 +++++++-
>   system/arch_init.c         | 4 ++--
>   2 files changed, 9 insertions(+), 3 deletions(-)
> 

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>