aboutsummaryrefslogtreecommitdiff
path: root/drivers/measured_boot/measured_boot.c
blob: 37fddfbdcfcccfd16e54e473f3d5db773bb31694 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * Copyright (c) 2020, Arm Limited. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <assert.h>

#include <common/debug.h>
#include <drivers/measured_boot/measured_boot.h>

/*
 * Init Measured Boot driver
 *
 * Initialises Event Log.
 */
void measured_boot_init(void)
{
	event_log_init();
}

/*
 * Finish Measured Boot driver
 *
 * Finalises Event Log and dumps the records to the debug console.
 */
void measured_boot_finish(void)
{
	uint8_t *log_addr;
	size_t log_size;
	int rc;

	rc = event_log_finalise(&log_addr, &log_size);
	if (rc != 0) {
		panic();
	}

	dump_event_log(log_addr, log_size);
}