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 14:43:46 +0200 |
commit | 80a1efdedd3099cde51cabf91789e037a6af11df (patch) | |
tree | f854e3976faa25a5b060bbbb27141c2f903483e2 /include | |
parent | 04bd6c3631e0184dcafb0403e0248a2052585914 (diff) | |
download | qemu-80a1efdedd3099cde51cabf91789e037a6af11df.zip qemu-80a1efdedd3099cde51cabf91789e037a6af11df.tar.gz qemu-80a1efdedd3099cde51cabf91789e037a6af11df.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 */ |