SPM: Use the right stack for SPM in multi-core builds
Change-Id: I7e4dc9175684ba4321e9defeda5e0ad836837c93
Signed-off-by: Chris Brand <chris.brand@cypress.com>
diff --git a/secure_fw/spm/ffm/backend_ipc.c b/secure_fw/spm/ffm/backend_ipc.c
index 4570f95..430848c 100644
--- a/secure_fw/spm/ffm/backend_ipc.c
+++ b/secure_fw/spm/ffm/backend_ipc.c
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2021, Arm Limited. All rights reserved.
+ * Copyright (c) 2021, Cypress Semiconductor Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -119,8 +120,10 @@
p_param = (void *)tfm_hal_get_ns_entry_point();
#ifdef CONFIG_TFM_PSA_API_THREAD_CALL
+#ifndef TFM_MULTI_CORE_TOPOLOGY
SPM_THREAD_CONTEXT = &p_pt->ctx_ctrl;
#endif
+#endif
}
@@ -135,6 +138,10 @@
uint32_t control;
struct partition_t *p_cur_pt;
+#ifdef CONFIG_TFM_PSA_API_THREAD_CALL
+ TFM_CORE_ASSERT(SPM_THREAD_CONTEXT);
+#endif
+
control = thrd_start_scheduler(&CURRENT_THREAD);
p_cur_pt = TO_CONTAINER(CURRENT_THREAD->p_context_ctrl,