SPM: Unify exception priority setting code
The exception priority setting code is spread into multiple
places while there is no significant difference between them.
Unify them together into one architecture function.
Change-Id: Iac15aff32065394b44f5318c66fb331842ec3b34
Signed-off-by: Ken Liu <Ken.Liu@arm.com>
diff --git a/secure_fw/spm/cmsis_psa/main.c b/secure_fw/spm/cmsis_psa/main.c
index d6b06c0..5bea871 100644
--- a/secure_fw/spm/cmsis_psa/main.c
+++ b/secure_fw/spm/cmsis_psa/main.c
@@ -116,24 +116,6 @@
return TFM_SUCCESS;
}
-static int32_t tfm_core_set_secure_exception_priorities(void)
-{
- enum tfm_plat_err_t plat_err = TFM_PLAT_ERR_SYSTEM_ERR;
-
- tfm_arch_prioritize_secure_exception();
-
- /* Explicitly set Secure SVC priority to highest */
- plat_err = tfm_spm_hal_set_secure_irq_priority(SVCall_IRQn, 0);
- if (plat_err != TFM_PLAT_ERR_SUCCESS) {
- return TFM_ERROR_GENERIC;
- }
-
- tfm_arch_set_fault_priority();
- tfm_arch_set_pendsv_priority();
-
- return TFM_SUCCESS;
-}
-
int main(void)
{
/* set Main Stack Pointer limit */
@@ -161,9 +143,7 @@
* Prioritise secure exceptions to avoid NS being able to pre-empt
* secure SVC or SecureFault. Do it before PSA API initialization.
*/
- if (tfm_core_set_secure_exception_priorities() != TFM_SUCCESS) {
- tfm_core_panic();
- }
+ tfm_arch_set_secure_exception_priorities();
/* Move to handler mode for further SPM initialization. */
tfm_core_handler_mode();