blob: 4dab4e3c4756c528000014e589bae8ee085c764b [file] [log] [blame]
Soby Mathewb911cc72017-02-13 12:46:28 +00001/*
Julius Werner2a231e32019-05-28 21:03:58 -07002 * Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved.
Soby Mathewb911cc72017-02-13 12:46:28 +00003 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Soby Mathewb911cc72017-02-13 12:46:28 +00005 */
6
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +00007#ifndef PARAM_HEADER_H
8#define PARAM_HEADER_H
Soby Mathewb911cc72017-02-13 12:46:28 +00009
Antonio Nino Diaz38b4ce02018-08-21 14:14:31 +010010#include <stdbool.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000011
Julius Werner53456fc2019-07-09 13:49:11 -070012#ifndef __ASSEMBLER__
Julius Werner2a231e32019-05-28 21:03:58 -070013#include <stdint.h>
Julius Werner53456fc2019-07-09 13:49:11 -070014#endif /*__ASSEMBLER__*/
Antonio Nino Diaz38b4ce02018-08-21 14:14:31 +010015
Julius Werner2a231e32019-05-28 21:03:58 -070016#include <export/common/param_header_exp.h>
Soby Mathewb911cc72017-02-13 12:46:28 +000017
Julius Werner2a231e32019-05-28 21:03:58 -070018#define VERSION_1 PARAM_VERSION_1
19#define VERSION_2 PARAM_VERSION_2
Soby Mathewb911cc72017-02-13 12:46:28 +000020
21#define SET_PARAM_HEAD(_p, _type, _ver, _attr) do { \
22 (_p)->h.type = (uint8_t)(_type); \
23 (_p)->h.version = (uint8_t)(_ver); \
Jeenu Viswambharan210f0a82018-08-02 10:14:12 +010024 (_p)->h.size = (uint16_t)sizeof(*(_p)); \
Soby Mathewb911cc72017-02-13 12:46:28 +000025 (_p)->h.attr = (uint32_t)(_attr) ; \
Antonio Nino Diaz38b4ce02018-08-21 14:14:31 +010026 } while (false)
Soby Mathewb911cc72017-02-13 12:46:28 +000027
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
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +000035#endif /* PARAM_HEADER_H */