1 /* 2 * Copyright (c) 2018-2024, Arm Limited. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 * 6 */ 7 #ifndef __TFM_SVCALLS_H__ 8 #define __TFM_SVCALLS_H__ 9 10 #include <stdint.h> 11 12 /** 13 * \brief The C source of SVCall handlers 14 * 15 * \param[in] msp MSP at SVCall entry. 16 * \param[in] exc_return EXC_RETURN value of the SVC. 17 * \param[in] psp PSP at SVCall entry. 18 19 * \returns EXC_RETURN value indicates where to return. 20 */ 21 uint32_t spm_svc_handler(uint32_t *msp, uint32_t exc_return, uint32_t *psp); 22 23 /** 24 * \brief Return from PSA API function executed in Thread mode. 25 * Trigger svc handler to restore thread context before entering PSA API function. 26 * 27 * \param[in] result PSA API function return value. 28 29 * \returns none. 30 */ 31 void tfm_svc_thread_mode_spm_return(psa_status_t result); 32 33 #if TFM_ISOLATION_LEVEL > 1 34 /** 35 * \brief Returns whether the current Thread mode context executes SPM code 36 * 37 * \returns True if the current thread mode context executes SPM code. 38 * False otherwise. 39 */ 40 bool tfm_svc_thread_mode_spm_active(void); 41 #endif /* TFM_ISOLATION_LEVEL > 1 */ 42 43 #endif 44