diff options
| author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-06-16 10:40:00 +0200 |
|---|---|---|
| committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-07-04 14:43:46 +0200 |
| commit | a9c2afd74b887b4775f425b72be1888220594bb5 (patch) | |
| tree | 050836d1d953168263554bf8e1568ffd34ceee11 /include | |
| parent | 80a1efdedd3099cde51cabf91789e037a6af11df (diff) | |
| download | focaccia-qemu-a9c2afd74b887b4775f425b72be1888220594bb5.tar.gz focaccia-qemu-a9c2afd74b887b4775f425b72be1888220594bb5.zip | |
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.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/include/system/whpx.h b/include/system/whpx.h index 00ff409b68..00f6a3e523 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 */ |