1 /* SPDX-License-Identifier: GPL-2.0 */
3 #ifndef __LINUX_TPM_EVENTLOG_H__
4 #define __LINUX_TPM_EVENTLOG_H__
6 #include <crypto/hash_info.h>
8 #define TCG_EVENT_NAME_LEN_MAX 255
9 #define MAX_TEXT_EVENT 1000 /* Max event string length */
10 #define ACPI_TCPA_SIG "TCPA" /* 0x41504354 /'TCPA' */
11 #define TPM2_ACTIVE_PCR_BANKS 3
13 #define EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2 0x1
14 #define EFI_TCG2_EVENT_LOG_FORMAT_TCG_2 0x2
17 #define do_endian_conversion(x) be32_to_cpu(x)
19 #define do_endian_conversion(x) x
22 enum bios_platform_class {
30 u8 pcr_value[20]; /* SHA1 */
35 enum tcpa_event_types {
46 PLATFORM_CONFIG_FLAGS,
56 struct tcpa_pc_event {
62 enum tcpa_pc_event_ids {
71 OPTION_ROM_MICROCODE = 10,
75 HOST_TABLE_OF_DEVICES,
78 /* http://www.trustedcomputinggroup.org/tcg-efi-protocol-specification/ */
80 struct tcg_efi_specid_event_algs {
85 struct tcg_efi_specid_event {
88 u8 spec_version_minor;
89 u8 spec_version_major;
93 struct tcg_efi_specid_event_algs digest_sizes[TPM2_ACTIVE_PCR_BANKS];
98 struct tcg_pcr_event {
106 struct tcg_event_field {
113 u8 digest[SHA512_DIGEST_SIZE];
116 struct tcg_pcr_event2 {
120 struct tpm2_digest digests[TPM2_ACTIVE_PCR_BANKS];
121 struct tcg_event_field event;