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