• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef PARAM_HEADER_H
8 #define PARAM_HEADER_H
9 
10 #include <stdbool.h>
11 
12 #ifndef __ASSEMBLER__
13 #include <stdint.h>
14 #endif /*__ASSEMBLER__*/
15 
16 #include <export/common/param_header_exp.h>
17 
18 #define VERSION_1	PARAM_VERSION_1
19 #define VERSION_2	PARAM_VERSION_2
20 
21 #define SET_PARAM_HEAD(_p, _type, _ver, _attr) do { \
22 	(_p)->h.type = (uint8_t)(_type); \
23 	(_p)->h.version = (uint8_t)(_ver); \
24 	(_p)->h.size = (uint16_t)sizeof(*(_p)); \
25 	(_p)->h.attr = (uint32_t)(_attr) ; \
26 	} while (false)
27 
28 /* Following is used for populating structure members statically. */
29 #define SET_STATIC_PARAM_HEAD(_p, _type, _ver, _p_type, _attr)	\
30 	._p.h.type = (uint8_t)(_type), \
31 	._p.h.version = (uint8_t)(_ver), \
32 	._p.h.size = (uint16_t)sizeof(_p_type), \
33 	._p.h.attr = (uint32_t)(_attr)
34 
35 #endif /* PARAM_HEADER_H */
36