ls_stack_protector.c 400 B

12345678910111213141516171819202122
  1. /*
  2. * Copyright 2018-2020 NXP
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #include <stdint.h>
  8. #include <arch_helpers.h>
  9. #include <plat/common/platform.h>
  10. #define RANDOM_CANARY_VALUE ((u_register_t) 3288484550995823360ULL)
  11. u_register_t plat_get_stack_protector_canary(void)
  12. {
  13. /*
  14. * TBD: Generate Random Number from NXP CAAM Block.
  15. */
  16. return RANDOM_CANARY_VALUE ^ read_cntpct_el0();
  17. }