README 1.6 KB

123456789101112131415161718192021222324252627282930313233
  1. All headers under include/export/ are export headers that are intended for
  2. inclusion in third-party code which needs to interact with TF-A data structures
  3. or interfaces. They must follow these special rules:
  4. - Header guards should start with ARM_TRUSTED_FIRMWARE_ to reduce clash risk.
  5. - All definitions should be sufficiently namespaced (e.g. with BL_ or TF_) to
  6. make name clashes with third-party code unlikely.
  7. - They must not #include any headers except other export headers, and those
  8. includes must use relative paths with "../double_quotes.h" notation.
  9. - They must not rely on any type definitions other that <stdint.h> types defined
  10. in the ISO C standard (i.e. uint64_t is fine, but not u_register_t). They
  11. should still not #include <stdint.h>. Instead, wrapper headers including
  12. export headers need to ensure that they #include <stdint.h> earlier in their
  13. include order.
  14. - They must not rely on any macro definitions other than those which are
  15. pre-defined by all common compilers (e.g. __ASSEMBLER__ or __aarch64__).
  16. - They must only contain macro, type and structure definitions, no prototypes.
  17. - They should avoid using integer types with architecture-dependent widths
  18. (e.g. long, uintptr_t, pointer types) where possible. (Some existing export
  19. headers are violating this for now.)
  20. - Their names should always end in "_exp.h".
  21. - Normal TF-A code should never include export headers directly. Instead, it
  22. should include a wrapper header that ensures the export header is included in
  23. the right manner. (The wrapper header for include/export/x/y/z_exp.h should
  24. normally be placed at include/x/y/z.h.)