drtm_measurements.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c) 2022 Arm Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #ifndef DRTM_MEASUREMENTS_H
  8. #define DRTM_MEASUREMENTS_H
  9. #include <stdint.h>
  10. #include "drtm_main.h"
  11. #include <platform_def.h>
  12. #define DRTM_EVENT_ARM_BASE 0x9000U
  13. #define DRTM_EVENT_TYPE(n) (DRTM_EVENT_ARM_BASE + (unsigned int)(n))
  14. #define DRTM_EVENT_ARM_PCR_SCHEMA DRTM_EVENT_TYPE(1)
  15. #define DRTM_EVENT_ARM_DCE DRTM_EVENT_TYPE(2)
  16. #define DRTM_EVENT_ARM_DCE_PUBKEY DRTM_EVENT_TYPE(3)
  17. #define DRTM_EVENT_ARM_DLME DRTM_EVENT_TYPE(4)
  18. #define DRTM_EVENT_ARM_DLME_EP DRTM_EVENT_TYPE(5)
  19. #define DRTM_EVENT_ARM_DEBUG_CONFIG DRTM_EVENT_TYPE(6)
  20. #define DRTM_EVENT_ARM_NONSECURE_CONFIG DRTM_EVENT_TYPE(7)
  21. #define DRTM_EVENT_ARM_DCE_SECONDARY DRTM_EVENT_TYPE(8)
  22. #define DRTM_EVENT_ARM_TZFW DRTM_EVENT_TYPE(9)
  23. #define DRTM_EVENT_ARM_SEPARATOR DRTM_EVENT_TYPE(10)
  24. #define CHECK_RC(rc, func_call) { \
  25. if (rc != 0) { \
  26. ERROR("%s(): " #func_call "failed unexpectedly rc=%d\n", \
  27. __func__, rc); \
  28. panic(); \
  29. } \
  30. }
  31. enum drtm_retc drtm_take_measurements(const struct_drtm_dl_args *a);
  32. void drtm_serialise_event_log(uint8_t *dst, size_t *event_log_size_out);
  33. #endif /* DRTM_MEASUREMENTS_H */