Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
[qemu.git] / include / sysemu / tpm.h
blobc8afa179e528232e216fccc31e9df5936dded280
1 /*
2 * Public TPM functions
4 * Copyright (C) 2011-2013 IBM Corporation
6 * Authors:
7 * Stefan Berger <stefanb@us.ibm.com>
9 * This work is licensed under the terms of the GNU GPL, version 2 or later.
10 * See the COPYING file in the top-level directory.
12 #ifndef QEMU_TPM_H
13 #define QEMU_TPM_H
15 #include "qemu/option.h"
17 typedef struct TPMState TPMState;
19 int tpm_config_parse(QemuOptsList *opts_list, const char *optarg);
20 int tpm_init(void);
21 void tpm_cleanup(void);
23 typedef enum TPMVersion {
24 TPM_VERSION_UNSPEC = 0,
25 TPM_VERSION_1_2 = 1,
26 TPM_VERSION_2_0 = 2,
27 } TPMVersion;
29 TPMVersion tpm_tis_get_tpm_version(Object *obj);
31 #define TYPE_TPM_TIS "tpm-tis"
33 static inline TPMVersion tpm_get_version(void)
35 #ifdef CONFIG_TPM
36 Object *obj = object_resolve_path_type("", TYPE_TPM_TIS, NULL);
38 if (obj) {
39 return tpm_tis_get_tpm_version(obj);
41 #endif
42 return TPM_VERSION_UNSPEC;
45 #endif /* QEMU_TPM_H */