1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 3 #ifndef LOGS_H_ 4 #define LOGS_H_ 5 6 #include <stdint.h> 7 #include <vb2_api.h> 8 9 /* coreboot-specific TPM log format */ 10 11 void *tpm_cb_log_init(void); 12 void *tpm_cb_log_cbmem_init(void); 13 void tpm_cb_preram_log_clear(void); 14 uint16_t tpm_cb_log_get_size(const void *log_table); 15 void tpm_cb_log_copy_entries(const void *from, void *to); 16 int tpm_cb_log_get(int entry_idx, int *pcr, const uint8_t **digest_data, 17 enum vb2_hash_algorithm *digest_algo, const char **event_name); 18 void tpm_cb_log_add_table_entry(const char *name, const uint32_t pcr, 19 enum vb2_hash_algorithm digest_algo, 20 const uint8_t *digest, 21 const size_t digest_len); 22 void tpm_cb_log_dump(void); 23 24 /* TPM 1.2 log format */ 25 26 void *tpm1_log_init(void); 27 void *tpm1_log_cbmem_init(void); 28 void tpm1_preram_log_clear(void); 29 uint16_t tpm1_log_get_size(const void *log_table); 30 void tpm1_log_copy_entries(const void *from, void *to); 31 int tpm1_log_get(int entry_idx, int *pcr, const uint8_t **digest_data, 32 enum vb2_hash_algorithm *digest_algo, const char **event_name); 33 void tpm1_log_add_table_entry(const char *name, const uint32_t pcr, 34 enum vb2_hash_algorithm digest_algo, 35 const uint8_t *digest, 36 const size_t digest_len); 37 void tpm1_log_dump(void); 38 39 /* TPM 2.0 log format */ 40 41 void *tpm2_log_init(void); 42 void *tpm2_log_cbmem_init(void); 43 void tpm2_preram_log_clear(void); 44 uint16_t tpm2_log_get_size(const void *log_table); 45 void tpm2_log_copy_entries(const void *from, void *to); 46 int tpm2_log_get(int entry_idx, int *pcr, const uint8_t **digest_data, 47 enum vb2_hash_algorithm *digest_algo, const char **event_name); 48 void tpm2_log_add_table_entry(const char *name, const uint32_t pcr, 49 enum vb2_hash_algorithm digest_algo, 50 const uint8_t *digest, 51 const size_t digest_len); 52 void tpm2_log_dump(void); 53 54 #endif /* LOGS_H_ */ 55