param_header.h 915 Bytes
Newer Older
1
/*
2
 * Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved.
3
 *
dp-arm's avatar
dp-arm committed
4
 * SPDX-License-Identifier: BSD-3-Clause
5
6
 */

7
8
#ifndef PARAM_HEADER_H
#define PARAM_HEADER_H
9

10
#include <stdbool.h>
11

12
13
14
#ifndef __ASSEMBLY__
#include <stdint.h>
#endif /*__ASSEMBLY__*/
15

16
#include <export/common/param_header_exp.h>
17

18
19
#define VERSION_1	PARAM_VERSION_1
#define VERSION_2	PARAM_VERSION_2
20
21
22
23

#define SET_PARAM_HEAD(_p, _type, _ver, _attr) do { \
	(_p)->h.type = (uint8_t)(_type); \
	(_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
29
30
31
32
33
34

/* Following is used for populating structure members statically. */
#define SET_STATIC_PARAM_HEAD(_p, _type, _ver, _p_type, _attr)	\
	._p.h.type = (uint8_t)(_type), \
	._p.h.version = (uint8_t)(_ver), \
	._p.h.size = (uint16_t)sizeof(_p_type), \
	._p.h.attr = (uint32_t)(_attr)

35
#endif /* PARAM_HEADER_H */