hv: sched: decouple idle stuff from schedule module

Let init thread end with run_idle_thread(), then idle thread take over and
start to do scheduling.
Change enter_guest_mode() to init_guest_mode() as run_idle_thread() is removed
out of it. Also add run_thread() in schedule module to run
thread_object's thread loop directly.

rename: switch_to_idle -> run_idle_thread

Tracked-On: #3813
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-10-16 19:16:37 +08:00
committed by ACRN System Integration
parent 27163df9b1
commit 0f70a5ca3a
5 changed files with 36 additions and 32 deletions

View File

@@ -53,7 +53,6 @@ uint16_t sched_get_pcpuid(const struct thread_object *obj);
struct thread_object *sched_get_current(uint16_t pcpu_id);
void init_sched(uint16_t pcpu_id);
void switch_to_idle(thread_entry_t idle_thread);
void get_schedule_lock(uint16_t pcpu_id);
void release_schedule_lock(uint16_t pcpu_id);
@@ -63,11 +62,12 @@ void remove_thread_obj(struct thread_object *obj, uint16_t pcpu_id);
void make_reschedule_request(uint16_t pcpu_id, uint16_t delmode);
bool need_reschedule(uint16_t pcpu_id);
void run_thread(struct thread_object *obj);
void sleep_thread(struct thread_object *obj);
void wake_thread(struct thread_object *obj);
void schedule(void);
void run_sched_thread(struct thread_object *obj);
void arch_switch_to(void *prev_sp, void *next_sp);
void run_idle_thread(void);
#endif /* SCHEDULE_H */