diff options
Diffstat (limited to 'include/sysemu/tpm.h')
-rw-r--r-- | include/sysemu/tpm.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/include/sysemu/tpm.h b/include/sysemu/tpm.h index 9b81ce9189..c1438907de 100644 --- a/include/sysemu/tpm.h +++ b/include/sysemu/tpm.h @@ -20,11 +20,24 @@ int tpm_config_parse(QemuOptsList *opts_list, const char *optarg); int tpm_init(void); void tpm_cleanup(void); +typedef enum TPMVersion { + TPM_VERSION_UNSPEC = 0, + TPM_VERSION_1_2 = 1, + TPM_VERSION_2_0 = 2, +} TPMVersion; + +TPMVersion tpm_tis_get_tpm_version(Object *obj); + #define TYPE_TPM_TIS "tpm-tis" -static inline bool tpm_find(void) +static inline TPMVersion tpm_get_version(void) { - return object_resolve_path_type("", TYPE_TPM_TIS, NULL); + Object *obj = object_resolve_path_type("", TYPE_TPM_TIS, NULL); + + if (obj) { + return tpm_tis_get_tpm_version(obj); + } + return TPM_VERSION_UNSPEC; } #endif /* QEMU_TPM_H */ |