utils_def_exp.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2016-2019, Arm Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef ARM_TRUSTED_FIRMWARE_EXPORT_LIB_UTILS_DEF_EXP_H
  7. #define ARM_TRUSTED_FIRMWARE_EXPORT_LIB_UTILS_DEF_EXP_H
  8. /* EXPORT HEADER -- See include/export/README for details! -- EXPORT HEADER */
  9. /*
  10. * For those constants to be shared between C and other sources, apply a 'U',
  11. * 'UL', 'ULL', 'L' or 'LL' suffix to the argument only in C, to avoid
  12. * undefined or unintended behaviour.
  13. *
  14. * The GNU assembler and linker do not support these suffixes (it causes the
  15. * build process to fail) therefore the suffix is omitted when used in linker
  16. * scripts and assembler files.
  17. */
  18. #if defined(__ASSEMBLER__)
  19. # define U(_x) (_x)
  20. # define UL(_x) (_x)
  21. # define ULL(_x) (_x)
  22. # define L(_x) (_x)
  23. # define LL(_x) (_x)
  24. #else
  25. # define U_(_x) (_x##U)
  26. # define U(_x) U_(_x)
  27. # define UL_(_x) (_x##UL)
  28. # define UL(_x) UL_(_x)
  29. # define ULL_(_x) (_x##ULL)
  30. # define ULL(_x) ULL_(_x)
  31. # define L_(_x) (_x##L)
  32. # define L(_x) L_(_x)
  33. # define LL_(_x) (_x##LL)
  34. # define LL(_x) LL_(_x)
  35. #endif
  36. #endif /* ARM_TRUSTED_FIRMWARE_EXPORT_LIB_UTILS_DEF_EXP_H */