]>
Commit | Line | Data |
---|---|---|
909ac65a MAL |
1 | /** @file\r |
2 | Macro and type definitions corresponding to the QEMU TPM interface.\r | |
3 | \r | |
4 | Refer to "docs/specs/tpm.txt" in the QEMU source directory.\r | |
5 | \r | |
6 | Copyright (C) 2018, Red Hat, Inc.\r | |
7 | Copyright (c) 2018, IBM Corporation. All rights reserved.<BR>\r | |
8 | \r | |
9 | This program and the accompanying materials are licensed and made available\r | |
10 | under the terms and conditions of the BSD License which accompanies this\r | |
11 | distribution. The full text of the license may be found at\r | |
12 | http://opensource.org/licenses/bsd-license.php\r | |
13 | \r | |
14 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r | |
15 | WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
16 | **/\r | |
17 | \r | |
18 | #ifndef __QEMU_TPM_H__\r | |
19 | #define __QEMU_TPM_H__\r | |
20 | \r | |
21 | #include <Base.h>\r | |
22 | \r | |
23 | //\r | |
24 | // whether function is blocked by BIOS settings; bits 0, 1, 2\r | |
25 | //\r | |
26 | #define QEMU_TPM_PPI_FUNC_NOT_IMPLEMENTED (0 << 0)\r | |
27 | #define QEMU_TPM_PPI_FUNC_BIOS_ONLY (1 << 0)\r | |
28 | #define QEMU_TPM_PPI_FUNC_BLOCKED (2 << 0)\r | |
29 | #define QEMU_TPM_PPI_FUNC_ALLOWED_USR_REQ (3 << 0)\r | |
30 | #define QEMU_TPM_PPI_FUNC_ALLOWED_USR_NOT_REQ (4 << 0)\r | |
31 | #define QEMU_TPM_PPI_FUNC_MASK (7 << 0)\r | |
32 | \r | |
33 | //\r | |
34 | // The following structure is shared between firmware and ACPI.\r | |
35 | //\r | |
36 | #pragma pack (1)\r | |
37 | typedef struct {\r | |
38 | UINT8 Func[256]; // func\r | |
39 | UINT8 In; // ppin\r | |
40 | UINT32 Ip; // ppip\r | |
41 | UINT32 Response; // pprp\r | |
42 | UINT32 Request; // pprq\r | |
43 | UINT32 RequestParameter; // pprm\r | |
44 | UINT32 LastRequest; // lppr\r | |
45 | UINT32 FRet; // fret\r | |
46 | UINT8 Res1[0x40]; // res1\r | |
47 | UINT8 NextStep; // next_step\r | |
48 | } QEMU_TPM_PPI;\r | |
49 | #pragma pack ()\r | |
50 | \r | |
51 | //\r | |
52 | // The following structure is for the fw_cfg etc/tpm/config file.\r | |
53 | //\r | |
54 | #pragma pack (1)\r | |
55 | typedef struct {\r | |
56 | UINT32 PpiAddress;\r | |
57 | UINT8 TpmVersion;\r | |
58 | UINT8 PpiVersion;\r | |
59 | } QEMU_FWCFG_TPM_CONFIG;\r | |
60 | #pragma pack ()\r | |
61 | \r | |
62 | #define QEMU_TPM_VERSION_UNSPEC 0\r | |
63 | #define QEMU_TPM_VERSION_1_2 1\r | |
64 | #define QEMU_TPM_VERSION_2 2\r | |
65 | \r | |
66 | #define QEMU_TPM_PPI_VERSION_NONE 0\r | |
67 | #define QEMU_TPM_PPI_VERSION_1_30 1\r | |
68 | \r | |
69 | #endif\r |