diff --git a/hypervisor/common/schedule.c b/hypervisor/common/schedule.c index 847bafd03..d9dc619fc 100644 --- a/hypervisor/common/schedule.c +++ b/hypervisor/common/schedule.c @@ -240,6 +240,11 @@ void kick_thread(const struct thread_object *obj) release_schedule_lock(pcpu_id, rflag); } +void yield_current(void) +{ + make_reschedule_request(get_pcpu_id(), DEL_MODE_IPI); +} + void run_thread(struct thread_object *obj) { uint64_t rflag; diff --git a/hypervisor/include/common/schedule.h b/hypervisor/include/common/schedule.h index 5179b5243..9d7c9d398 100644 --- a/hypervisor/include/common/schedule.h +++ b/hypervisor/include/common/schedule.h @@ -109,6 +109,7 @@ void run_thread(struct thread_object *obj); void sleep_thread(struct thread_object *obj); void wake_thread(struct thread_object *obj); void kick_thread(const struct thread_object *obj); +void yield_current(void); void schedule(void); void arch_switch_to(void *prev_sp, void *next_sp);