]> git.proxmox.com Git - mirror_qemu.git/blame - include/sysemu/tpm.h
Merge branch 'icount-update' into HEAD
[mirror_qemu.git] / include / sysemu / tpm.h
CommitLineData
d1a0cf73
SB
1/*
2 * Public TPM functions
3 *
4 * Copyright (C) 2011-2013 IBM Corporation
5 *
6 * Authors:
7 * Stefan Berger <stefanb@us.ibm.com>
8 *
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.
11 */
12#ifndef QEMU_TPM_H
13#define QEMU_TPM_H
14
15#include "qemu/option.h"
16
8f0605cc 17typedef struct TPMState TPMState;
8f0605cc 18
d1a0cf73
SB
19int tpm_config_parse(QemuOptsList *opts_list, const char *optarg);
20int tpm_init(void);
21void tpm_cleanup(void);
22
116694c3
SB
23typedef enum TPMVersion {
24 TPM_VERSION_UNSPEC = 0,
25 TPM_VERSION_1_2 = 1,
26 TPM_VERSION_2_0 = 2,
27} TPMVersion;
28
5cb18b3d
SB
29TPMVersion tpm_tis_get_tpm_version(Object *obj);
30
711b20b4
SB
31#define TYPE_TPM_TIS "tpm-tis"
32
5cb18b3d 33static inline TPMVersion tpm_get_version(void)
711b20b4 34{
977ad992 35#ifdef CONFIG_TPM
5cb18b3d
SB
36 Object *obj = object_resolve_path_type("", TYPE_TPM_TIS, NULL);
37
38 if (obj) {
39 return tpm_tis_get_tpm_version(obj);
40 }
977ad992 41#endif
5cb18b3d 42 return TPM_VERSION_UNSPEC;
711b20b4
SB
43}
44
d1a0cf73 45#endif /* QEMU_TPM_H */