--- /dev/null
+/** @file\r
+ Macro and type definitions corresponding to the QEMU TPM interface.\r
+\r
+ Refer to "docs/specs/tpm.txt" in the QEMU source directory.\r
+\r
+ Copyright (C) 2018, Red Hat, Inc.\r
+ Copyright (c) 2018, IBM Corporation. All rights reserved.<BR>\r
+\r
+ This program and the accompanying materials are licensed and made available\r
+ under the terms and conditions of the BSD License which accompanies this\r
+ distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
+ WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+**/\r
+\r
+#ifndef __QEMU_TPM_H__\r
+#define __QEMU_TPM_H__\r
+\r
+#include <Base.h>\r
+\r
+//\r
+// whether function is blocked by BIOS settings; bits 0, 1, 2\r
+//\r
+#define QEMU_TPM_PPI_FUNC_NOT_IMPLEMENTED (0 << 0)\r
+#define QEMU_TPM_PPI_FUNC_BIOS_ONLY (1 << 0)\r
+#define QEMU_TPM_PPI_FUNC_BLOCKED (2 << 0)\r
+#define QEMU_TPM_PPI_FUNC_ALLOWED_USR_REQ (3 << 0)\r
+#define QEMU_TPM_PPI_FUNC_ALLOWED_USR_NOT_REQ (4 << 0)\r
+#define QEMU_TPM_PPI_FUNC_MASK (7 << 0)\r
+\r
+//\r
+// The following structure is shared between firmware and ACPI.\r
+//\r
+#pragma pack (1)\r
+typedef struct {\r
+ UINT8 Func[256]; // func\r
+ UINT8 In; // ppin\r
+ UINT32 Ip; // ppip\r
+ UINT32 Response; // pprp\r
+ UINT32 Request; // pprq\r
+ UINT32 RequestParameter; // pprm\r
+ UINT32 LastRequest; // lppr\r
+ UINT32 FRet; // fret\r
+ UINT8 Res1[0x40]; // res1\r
+ UINT8 NextStep; // next_step\r
+} QEMU_TPM_PPI;\r
+#pragma pack ()\r
+\r
+//\r
+// The following structure is for the fw_cfg etc/tpm/config file.\r
+//\r
+#pragma pack (1)\r
+typedef struct {\r
+ UINT32 PpiAddress;\r
+ UINT8 TpmVersion;\r
+ UINT8 PpiVersion;\r
+} QEMU_FWCFG_TPM_CONFIG;\r
+#pragma pack ()\r
+\r
+#define QEMU_TPM_VERSION_UNSPEC 0\r
+#define QEMU_TPM_VERSION_1_2 1\r
+#define QEMU_TPM_VERSION_2 2\r
+\r
+#define QEMU_TPM_PPI_VERSION_NONE 0\r
+#define QEMU_TPM_PPI_VERSION_1_30 1\r
+\r
+#endif\r