diff options
author | Yonghee Han <onstudy@samsung.com> | 2016-07-27 16:40:17 +0900 |
---|---|---|
committer | Yonghee Han <onstudy@samsung.com> | 2016-07-27 00:53:56 -0700 |
commit | 3158f4a51894e46ecb593bffbfd12824e1d6534a (patch) | |
tree | 2bef7f0238e687c5de65f48b5995ee124a95d157 /include/sysemu/tpm.h | |
parent | a3b133b0ea0696e42fd876b9a803e28bc6ef5299 (diff) | |
download | qemu-3158f4a51894e46ecb593bffbfd12824e1d6534a.tar.gz qemu-3158f4a51894e46ecb593bffbfd12824e1d6534a.tar.bz2 qemu-3158f4a51894e46ecb593bffbfd12824e1d6534a.zip |
Imported Upstream version 2.4.1upstream/2.4.1
Change-Id: I0b584f569cb0e0f4eac13cdb79e110c2dbc34bfc
Diffstat (limited to 'include/sysemu/tpm.h')
-rw-r--r-- | include/sysemu/tpm.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/include/sysemu/tpm.h b/include/sysemu/tpm.h index 9b81ce918..c8afa179e 100644 --- a/include/sysemu/tpm.h +++ b/include/sysemu/tpm.h @@ -20,11 +20,26 @@ 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); +#ifdef CONFIG_TPM + Object *obj = object_resolve_path_type("", TYPE_TPM_TIS, NULL); + + if (obj) { + return tpm_tis_get_tpm_version(obj); + } +#endif + return TPM_VERSION_UNSPEC; } #endif /* QEMU_TPM_H */ |