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