2 * tpm_tis.h - QEMU's TPM TIS interface emulator
4 * Copyright (C) 2006, 2010-2013 IBM Corporation
7 * Stefan Berger <stefanb@us.ibm.com>
8 * David Safford <safford@us.ibm.com>
10 * This work is licensed under the terms of the GNU GPL, version 2 or later.
11 * See the COPYING file in the top-level directory.
13 * Implementation of the TIS interface according to specs found at
14 * http://www.trustedcomputinggroup.org
20 #include "hw/isa/isa.h"
21 #include "hw/acpi/tpm.h"
22 #include "qemu-common.h"
24 #define TPM_TIS_NUM_LOCALITIES 5 /* per spec */
25 #define TPM_TIS_LOCALITY_SHIFT 12
26 #define TPM_TIS_NO_LOCALITY 0xff
28 #define TPM_TIS_IS_VALID_LOCTY(x) ((x) < TPM_TIS_NUM_LOCALITIES)
30 #define TPM_TIS_BUFFER_MAX 4096
33 TPM_TIS_STATE_IDLE
= 0,
35 TPM_TIS_STATE_COMPLETION
,
36 TPM_TIS_STATE_EXECUTION
,
37 TPM_TIS_STATE_RECEPTION
,
40 /* locality data -- all fields are persisted */
41 typedef struct TPMLocality
{
51 TPMSizedBuffer w_buffer
;
52 TPMSizedBuffer r_buffer
;
55 typedef struct TPMTISEmuState
{
58 uint8_t buf
[TPM_TIS_BUFFER_MAX
];
61 uint8_t aborting_locty
;
64 TPMLocality loc
[TPM_TIS_NUM_LOCALITIES
];
70 #endif /* TPM_TPM_TIS_H */