1 /* 2 * Copyright (c) 2019-2021, Arm Limited. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 * 6 */ 7 8 #ifndef __TFM_CORE_TRUSTZONE_H__ 9 #define __TFM_CORE_TRUSTZONE_H__ 10 11 #include "security_defs.h" 12 13 /* This file holds specification or design defined TrustZone settings. */ 14 15 /* 16 * To avoid faking jump with FNC_RETURN or EXC_RETURN in NSPE, seal the secure 17 * stack by putting two words (8 bytes) at the start of stack (higher address) 18 * of it. The Armv8-M Architecture Reference Manual recommends to use seal value 19 * 0xFEF5EDA5. 20 */ 21 #define TFM_STACK_SEALED_SIZE 8 22 #define TFM_STACK_SEAL_VALUE STACK_SEAL_PATTERN 23 24 /* 25 * The numbers in 32bit words while basic FP involved in preempted context: 26 * S0 - S15, FPSCR, Reserved 27 */ 28 #define TFM_BASIC_FP_CONTEXT_WORDS 18 29 30 /* 31 * The numbers in 32bit words while addtional FP involved in preempted context: 32 * S16 - S31 33 */ 34 #define TFM_ADDTIONAL_FP_CONTEXT_WORDS 16 35 36 /* 37 * SG sets LR[0] to ZERO indicates a non-secure to secure transition. 38 * Make sure to apply this mask on a 'LR' just after 'SG' (in veneer). 39 */ 40 #define TFM_VENEER_LR_BIT0_MASK 1 41 42 #endif /* __TFM_CORE_TRUSTZONE_H__ */ 43