Core: Add non-secure thread entry
The non-secure thread entry is used to replace the idle thread.
It takes over the main init process, and jump to the non-secure
world at last.
- Set the non-secure thread entry with the lowest priority.
- Delete the idle thread which is unused anymore.
- Refine tfm_pendsv_do_schedule() function, does not need to handle
the idle thread.
Change-Id: Id2b04647db26b92c61f5f63fb0ac0f814a55aab4
Signed-off-by: Edison Ai <edison.ai@arm.com>
diff --git a/secure_fw/spm/spm_api.c b/secure_fw/spm/spm_api.c
index a1ee127..05d6c8d 100644
--- a/secure_fw/spm/spm_api.c
+++ b/secure_fw/spm/spm_api.c
@@ -110,7 +110,14 @@
part_ptr = &(g_spm_partition_db.partitions[
g_spm_partition_db.partition_count]);
part_ptr->static_data.partition_id = TFM_SP_NON_SECURE_ID;
+#if TFM_PSA_API
+ part_ptr->static_data.partition_flags = SPM_PART_FLAG_APP_ROT |
+ SPM_PART_FLAG_IPC;
+ part_ptr->static_data.partition_priority = TFM_PRIORITY_LOW;
+ part_ptr->static_data.partition_init = tfm_nspm_thread_entry;
+#else
part_ptr->static_data.partition_flags = 0;
+#endif
#if TFM_LVL != 1
part_ptr->memory_data.stack_bottom = psp_stack_bottom;