1 /*****************************************************************************
2  * Copyright (c) 2015-2020 IBM Corporation
3  * All rights reserved.
4  * This program and the accompanying materials
5  * are made available under the terms of the BSD License
6  * which accompanies this distribution, and is available at
7  * http://www.opensource.org/licenses/bsd-license.php
8  *
9  * Contributors:
10  *     IBM Corporation - initial implementation
11  *****************************************************************************/
12 
13 #ifndef TCGBIOS_H
14 #define TCGBIOS_H
15 
16 #include <stdint.h>
17 #include <stdbool.h>
18 
19 uint32_t tpm_start(void);
20 void tpm_finalize(void);
21 uint32_t tpm_leave_firmware(void);
22 uint32_t tpm_measure_scrtm(void);
23 void tpm_set_log_parameters(void *address, size_t size);
24 uint32_t tpm_get_logsize(void);
25 uint32_t tpm_measure_bcv_mbr(uint32_t bootdrv, const uint8_t *addr,
26                              uint32_t length);
27 uint32_t tpm_add_event_separators(uint32_t start_pcr, uint32_t end_pcr);
28 uint32_t tpm_driver_get_failure_reason(void);
29 void tpm_driver_set_failure_reason(uint32_t errcode);
30 bool tpm_is_working(void);
31 void tpm20_menu(void);
32 void tpm_gpt_set_lba1(const uint8_t *addr, uint32_t length);
33 void tpm_gpt_add_entry(const uint8_t *addr, uint32_t length);
34 uint32_t tpm_measure_gpt(void);
35 
36 #endif /* TCGBIOS_H */
37