aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2025-06-16 10:40:00 +0200
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2025-07-04 12:08:44 +0200
commitd5a407a5763c4f5182124bb08c9157c0c667662f (patch)
tree2942fef338365a18335ba591d2a219f2c3638d98 /include
parentb6637bd5561d1d03f3a3d4335102cbf57fad5ad0 (diff)
downloadqemu-d5a407a5763c4f5182124bb08c9157c0c667662f.zip
qemu-d5a407a5763c4f5182124bb08c9157c0c667662f.tar.gz
qemu-d5a407a5763c4f5182124bb08c9157c0c667662f.tar.bz2
accel/whpx: Expose whpx_enabled() to common code
Currently whpx_enabled() is restricted to target-specific code. By defining CONFIG_WHPX_IS_POSSIBLE we allow its use anywhere. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20250703173248.44995-26-philmd@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/system/whpx.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/include/system/whpx.h b/include/system/whpx.h
index 00ff409..00f6a3e 100644
--- a/include/system/whpx.h
+++ b/include/system/whpx.h
@@ -16,19 +16,20 @@
#define QEMU_WHPX_H
#ifdef COMPILING_PER_TARGET
+# ifdef CONFIG_WHPX
+# define CONFIG_WHPX_IS_POSSIBLE
+# endif /* !CONFIG_WHPX */
+#else
+# define CONFIG_WHPX_IS_POSSIBLE
+#endif /* COMPILING_PER_TARGET */
-#ifdef CONFIG_WHPX
-
-int whpx_enabled(void);
+#ifdef CONFIG_WHPX_IS_POSSIBLE
+extern bool whpx_allowed;
+#define whpx_enabled() (whpx_allowed)
bool whpx_apic_in_platform(void);
-
-#else /* CONFIG_WHPX */
-
-#define whpx_enabled() (0)
+#else /* !CONFIG_WHPX_IS_POSSIBLE */
+#define whpx_enabled() 0
#define whpx_apic_in_platform() (0)
-
-#endif /* CONFIG_WHPX */
-
-#endif /* COMPILING_PER_TARGET */
+#endif /* !CONFIG_WHPX_IS_POSSIBLE */
#endif /* QEMU_WHPX_H */