param_header.h 917 B

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