diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-06-16 10:39:09 +0200 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-07-04 12:08:44 +0200 |
commit | b6637bd5561d1d03f3a3d4335102cbf57fad5ad0 (patch) | |
tree | 3ad30aee7967b1c90701e140b1dee0406636ddf8 /include | |
parent | 60c9cec12c99e47fb2c82ad5dca36c9441b623dc (diff) | |
download | qemu-b6637bd5561d1d03f3a3d4335102cbf57fad5ad0.zip qemu-b6637bd5561d1d03f3a3d4335102cbf57fad5ad0.tar.gz qemu-b6637bd5561d1d03f3a3d4335102cbf57fad5ad0.tar.bz2 |
accel/nvmm: Expose nvmm_enabled() to common code
Currently nvmm_enabled() is restricted to target-specific code.
By defining CONFIG_NVMM_IS_POSSIBLE we allow its use anywhere.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-Id: <20250703173248.44995-25-philmd@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/system/nvmm.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/include/system/nvmm.h b/include/system/nvmm.h index 6971ddb..7390def 100644 --- a/include/system/nvmm.h +++ b/include/system/nvmm.h @@ -13,17 +13,18 @@ #define QEMU_NVMM_H #ifdef COMPILING_PER_TARGET - -#ifdef CONFIG_NVMM - -int nvmm_enabled(void); - -#else /* CONFIG_NVMM */ - -#define nvmm_enabled() (0) - -#endif /* CONFIG_NVMM */ - +# ifdef CONFIG_NVMM +# define CONFIG_NVMM_IS_POSSIBLE +# endif /* !CONFIG_NVMM */ +#else +# define CONFIG_NVMM_IS_POSSIBLE #endif /* COMPILING_PER_TARGET */ +#ifdef CONFIG_NVMM_IS_POSSIBLE +extern bool nvmm_allowed; +#define nvmm_enabled() (nvmm_allowed) +#else /* !CONFIG_NVMM_IS_POSSIBLE */ +#define nvmm_enabled() 0 +#endif /* !CONFIG_NVMM_IS_POSSIBLE */ + #endif /* QEMU_NVMM_H */ |