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/tfm_thread.h b/secure_fw/spm/cmsis_psa/tfm_thread.h
index 925967b..8e96e3f 100644
--- a/secure_fw/spm/cmsis_psa/tfm_thread.h
+++ b/secure_fw/spm/cmsis_psa/tfm_thread.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -14,7 +14,7 @@
/* State code */
#define THRD_STATE_CREATING 0
-#define THRD_STATE_RUNNING 1
+#define THRD_STATE_RUNNABLE 1
#define THRD_STATE_BLOCK 2
#define THRD_STATE_DETACH 3
#define THRD_STATE_INVALID 4
@@ -170,15 +170,15 @@
* Return :
* Current running thread context pointer.
*/
-struct tfm_core_thread_t *tfm_core_thrd_get_curr_thread(void);
+struct tfm_core_thread_t *tfm_core_thrd_get_curr(void);
/*
- * Get next running thread in list.
+ * Get next thread to run in list.
*
* Return :
- * Pointer of next thread to be run.
+ * Pointer of next thread to run.
*/
-struct tfm_core_thread_t *tfm_core_thrd_get_next_thread(void);
+struct tfm_core_thread_t *tfm_core_thrd_get_next(void);
/*
* Start scheduler for existing threads