]> git.proxmox.com Git - qemu.git/blame - hw/tpm/tpm_int.h
acpi-build: disable with -no-acpi
[qemu.git] / hw / tpm / tpm_int.h
CommitLineData
d1a0cf73
SB
1/*
2 * TPM configuration
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 TPM_TPM_INT_H
13#define TPM_TPM_INT_H
14
15#include "exec/memory.h"
bdee56f5 16#include "tpm_tis.h"
d1a0cf73 17
d1a0cf73 18/* overall state of the TPM interface */
8243b046 19struct TPMState {
d1a0cf73
SB
20 ISADevice busdev;
21 MemoryRegion mmio;
22
23 union {
24 TPMTISEmuState tis;
25 } s;
26
27 uint8_t locty_number;
28 TPMLocality *locty_data;
29
30 char *backend;
31 TPMBackend *be_driver;
8243b046 32};
d1a0cf73
SB
33
34#define TPM(obj) OBJECT_CHECK(TPMState, (obj), TYPE_TPM_TIS)
35
bb716238
SB
36#define TPM_STANDARD_CMDLINE_OPTS \
37 { \
38 .name = "type", \
39 .type = QEMU_OPT_STRING, \
40 .help = "Type of TPM backend", \
41 }
42
4549a8b7
SB
43struct tpm_req_hdr {
44 uint16_t tag;
45 uint32_t len;
46 uint32_t ordinal;
47} QEMU_PACKED;
48
49struct tpm_resp_hdr {
50 uint16_t tag;
51 uint32_t len;
52 uint32_t errcode;
53} QEMU_PACKED;
54
55#define TPM_TAG_RQU_COMMAND 0xc1
56#define TPM_TAG_RQU_AUTH1_COMMAND 0xc2
57#define TPM_TAG_RQU_AUTH2_COMMAND 0xc3
58
59#define TPM_TAG_RSP_COMMAND 0xc4
60#define TPM_TAG_RSP_AUTH1_COMMAND 0xc5
61#define TPM_TAG_RSP_AUTH2_COMMAND 0xc6
62
63#define TPM_FAIL 9
64
65#define TPM_ORD_GetTicks 0xf1
66
d1a0cf73 67#endif /* TPM_TPM_INT_H */