mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 09:47:44 +00:00
hv: sched: move schedule initialization to each pcpu init
schedule infrastructure is per pcpu, so move its initialization to each pcpu's initialization. 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:
committed by
ACRN System Integration
parent
dadcdcefa0
commit
fafd5cf063
@@ -27,19 +27,13 @@ uint16_t sched_get_pcpuid(const struct thread_object *obj)
|
||||
return obj->pcpu_id;
|
||||
}
|
||||
|
||||
void init_scheduler(void)
|
||||
void init_sched(uint16_t pcpu_id)
|
||||
{
|
||||
struct sched_control *ctl;
|
||||
uint32_t i;
|
||||
uint16_t pcpu_nums = get_pcpu_nums();
|
||||
struct sched_control *ctl = &per_cpu(sched_ctl, pcpu_id);
|
||||
|
||||
for (i = 0U; i < pcpu_nums; i++) {
|
||||
ctl = &per_cpu(sched_ctl, i);
|
||||
|
||||
spinlock_init(&ctl->scheduler_lock);
|
||||
ctl->flags = 0UL;
|
||||
ctl->curr_obj = NULL;
|
||||
}
|
||||
spinlock_init(&ctl->scheduler_lock);
|
||||
ctl->flags = 0UL;
|
||||
ctl->curr_obj = NULL;
|
||||
}
|
||||
|
||||
void get_schedule_lock(uint16_t pcpu_id)
|
||||
|
Reference in New Issue
Block a user