xref: /aosp_15_r20/external/gsc-utils/boot_param/boot_param.h (revision 4f2df630800bdcf1d4f0decf95d8a1cb87344f5f)
1 /*
2  * Copyright 2024 The ChromiumOS Authors
3  * Use of this source code is governed by a BSD-style license that can be
4  * found in the LICENSE file.
5  */
6 
7 #ifndef __GSC_UTILS_BOOT_PARAM_BOOT_PARAM_H
8 #define __GSC_UTILS_BOOT_PARAM_BOOT_PARAM_H
9 
10 #include "boot_param_types.h"
11 #include "boot_param_platform.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 /* Size of BootParam structure in bytes */
18 #define BOOT_PARAM_SIZE 820
19 
20 /* Get (part of) BootParam structure: [offset .. offset + size) */
21 size_t get_boot_param_bytes(
22 	/* [OUT] destination buffer to fill */
23 	uint8_t *dest,
24 	/* [IN] starting offset in the BootParam struct */
25 	size_t offset,
26 	/* [IN] size of the data to copy */
27 	size_t size
28 );
29 
30 /* Size of DiceChain structure in bytes */
31 #define DICE_CHAIN_SIZE 605
32 
33 /* Get (part of) DiceChain structure: [offset .. offset + size) */
34 size_t get_dice_chain_bytes(
35 	/* [OUT] destination buffer to fill */
36 	uint8_t *dest,
37 	/* [IN] starting offset in the DiceChain struct */
38 	size_t offset,
39 	/* [IN] size of the data to copy */
40 	size_t size
41 );
42 
43 #ifdef __cplusplus
44 } /* extern "C" */
45 #endif
46 
47 #endif /* __GSC_UTILS_BOOT_PARAM_BOOT_PARAM_H */
48