SPM: Update thread state naming
The thread state THRD_STATE_RUNNING is actually used as runnable.
For example, in the tfm_event_wake() function, a thread woke up by
an event is only becoming runnable. Whether to make it as the current
running thread is decided by scheduler with other condition checks
such as priority - only the thread has highest priority in the runnable
list can run.
The current running thread is indicated by CURR_THRD.
This patch updates the naming to reflect the actual implementation.
Also moves some static functions to caller to simply the code.
Change-Id: Ib8c843c85feff35d6d6287bf82093801e3168e80
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/secure_fw/spm/cmsis_psa/spm_ipc.c b/secure_fw/spm/cmsis_psa/spm_ipc.c
index 782d9a8..c86be41 100644
--- a/secure_fw/spm/cmsis_psa/spm_ipc.c
+++ b/secure_fw/spm/cmsis_psa/spm_ipc.c
@@ -377,7 +377,7 @@
struct partition_t *tfm_spm_get_running_partition(void)
{
- struct tfm_core_thread_t *pth = tfm_core_thrd_get_curr_thread();
+ struct tfm_core_thread_t *pth = tfm_core_thrd_get_curr();
struct partition_t *partition;
partition = TFM_GET_CONTAINER_PTR(pth, struct partition_t, sp_thread);
@@ -754,8 +754,8 @@
struct partition_t *p_next_partition;
uint32_t is_privileged;
#endif
- struct tfm_core_thread_t *pth_next = tfm_core_thrd_get_next_thread();
- struct tfm_core_thread_t *pth_curr = tfm_core_thrd_get_curr_thread();
+ struct tfm_core_thread_t *pth_next = tfm_core_thrd_get_next();
+ struct tfm_core_thread_t *pth_curr = tfm_core_thrd_get_curr();
if (pth_next != NULL && pth_curr != pth_next) {
#if TFM_LVL != 1