commonlib: Refactor CSE sync eventLog
[coreboot2.git] / src / security / tpm / tspi / logs.h
blob2d802f0bc5fba7dfe5047618b4040dfb5b0ce6f4
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef LOGS_H_
4 #define LOGS_H_
6 #include <stdint.h>
7 #include <vb2_api.h>
9 /* coreboot-specific TPM log format */
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);
24 /* TPM 1.2 log format */
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);
39 /* TPM 2.0 log format */
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);
54 #endif /* LOGS_H_ */