Soby Mathew | b911cc7 | 2017-02-13 12:46:28 +0000 | [diff] [blame] | 1 | /* |
Julius Werner | 2a231e3 | 2019-05-28 21:03:58 -0700 | [diff] [blame] | 2 | * Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved. |
Soby Mathew | b911cc7 | 2017-02-13 12:46:28 +0000 | [diff] [blame] | 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Soby Mathew | b911cc7 | 2017-02-13 12:46:28 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 7 | #ifndef PARAM_HEADER_H |
| 8 | #define PARAM_HEADER_H |
Soby Mathew | b911cc7 | 2017-02-13 12:46:28 +0000 | [diff] [blame] | 9 | |
Antonio Nino Diaz | 38b4ce0 | 2018-08-21 14:14:31 +0100 | [diff] [blame] | 10 | #include <stdbool.h> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 11 | |
Julius Werner | 53456fc | 2019-07-09 13:49:11 -0700 | [diff] [blame] | 12 | #ifndef __ASSEMBLER__ |
Julius Werner | 2a231e3 | 2019-05-28 21:03:58 -0700 | [diff] [blame] | 13 | #include <stdint.h> |
Julius Werner | 53456fc | 2019-07-09 13:49:11 -0700 | [diff] [blame] | 14 | #endif /*__ASSEMBLER__*/ |
Antonio Nino Diaz | 38b4ce0 | 2018-08-21 14:14:31 +0100 | [diff] [blame] | 15 | |
Julius Werner | 2a231e3 | 2019-05-28 21:03:58 -0700 | [diff] [blame] | 16 | #include <export/common/param_header_exp.h> |
Soby Mathew | b911cc7 | 2017-02-13 12:46:28 +0000 | [diff] [blame] | 17 | |
Julius Werner | 2a231e3 | 2019-05-28 21:03:58 -0700 | [diff] [blame] | 18 | #define VERSION_1 PARAM_VERSION_1 |
| 19 | #define VERSION_2 PARAM_VERSION_2 |
Soby Mathew | b911cc7 | 2017-02-13 12:46:28 +0000 | [diff] [blame] | 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); \ |
Jeenu Viswambharan | 210f0a8 | 2018-08-02 10:14:12 +0100 | [diff] [blame] | 24 | (_p)->h.size = (uint16_t)sizeof(*(_p)); \ |
Soby Mathew | b911cc7 | 2017-02-13 12:46:28 +0000 | [diff] [blame] | 25 | (_p)->h.attr = (uint32_t)(_attr) ; \ |
Antonio Nino Diaz | 38b4ce0 | 2018-08-21 14:14:31 +0100 | [diff] [blame] | 26 | } while (false) |
Soby Mathew | b911cc7 | 2017-02-13 12:46:28 +0000 | [diff] [blame] | 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 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 35 | #endif /* PARAM_HEADER_H */ |