hv: sched: add status for thread_object

Now, we have three valid status for thread_object:
	THREAD_STS_RUNNING,
	THREAD_STS_RUNNABLE,
	THREAD_STS_BLOCKED.
This patch also provide several helpers to check the thread's status and
a status set wrapper function.

Tracked-On: #3813
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: Yu Wang <yu1.wang@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Shuo A Liu
2019-06-13 14:32:40 +08:00
committed by ACRN System Integration
parent fafd5cf063
commit 9b8c6e6a90
2 changed files with 34 additions and 0 deletions

View File

@@ -13,6 +13,12 @@
#define DEL_MODE_INIT (1U)
#define DEL_MODE_IPI (2U)
enum thread_object_state {
THREAD_STS_RUNNING = 1,
THREAD_STS_RUNNABLE,
THREAD_STS_BLOCKED
};
struct thread_object;
typedef void (*thread_entry_t)(struct thread_object *obj);
typedef void (*switch_t)(struct thread_object *obj);
@@ -21,6 +27,7 @@ struct thread_object {
uint16_t pcpu_id;
struct sched_control *sched_ctl;
thread_entry_t thread_entry;
volatile enum thread_object_state status;
uint64_t host_sp;
switch_t switch_out;