Files
acrn-hypervisor/hypervisor/common/sched_noop.c
Xue Bosheng 034cccb7a4 hv: fix build issue in schedule module
change header file from asm/per_cpu.h to per_cpu.h in sched_noop.c and
sched_prio.c, remove return of sched_iorr_del_timer function.

Tracked-On: #8812
Signed-off-by: Xue Bosheng <bosheng.xue@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2025-09-30 12:31:07 +08:00

56 lines
1.3 KiB
C

/*
* Copyright (C) 2019-2022 Intel Corporation.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <per_cpu.h>
#include <schedule.h>
static int32_t sched_noop_init(struct sched_control *ctl)
{
struct sched_noop_control *noop_ctl = &per_cpu(sched_noop_ctl, ctl->pcpu_id);
ctl->priv = noop_ctl;
return 0;
}
static struct thread_object *sched_noop_pick_next(struct sched_control *ctl)
{
struct sched_noop_control *noop_ctl = (struct sched_noop_control *)ctl->priv;
struct thread_object *next = NULL;
if (noop_ctl->noop_thread_obj != NULL) {
next = noop_ctl->noop_thread_obj;
} else {
next = &get_cpu_var(idle);
}
return next;
}
static void sched_noop_sleep(struct thread_object *obj)
{
struct sched_noop_control *noop_ctl = (struct sched_noop_control *)obj->sched_ctl->priv;
if (noop_ctl->noop_thread_obj == obj) {
noop_ctl->noop_thread_obj = NULL;
}
}
static void sched_noop_wake(struct thread_object *obj)
{
struct sched_noop_control *noop_ctl = (struct sched_noop_control *)obj->sched_ctl->priv;
if (noop_ctl->noop_thread_obj == NULL) {
noop_ctl->noop_thread_obj = obj;
}
}
struct acrn_scheduler sched_noop = {
.name = "sched_noop",
.init = sched_noop_init,
.pick_next = sched_noop_pick_next,
.sleep = sched_noop_sleep,
.wake = sched_noop_wake,
};