mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-02 00:08:43 +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:
parent
dadcdcefa0
commit
fafd5cf063
@ -218,8 +218,6 @@ void init_pcpu_post(uint16_t pcpu_id)
|
||||
pr_fatal("Please apply the latest CPU uCode patch!");
|
||||
}
|
||||
|
||||
init_scheduler();
|
||||
|
||||
/* Initialize interrupts */
|
||||
init_interrupt(BOOT_CPU_ID);
|
||||
|
||||
@ -258,6 +256,8 @@ void init_pcpu_post(uint16_t pcpu_id)
|
||||
wait_sync_change(&pcpu_sync, 0UL);
|
||||
}
|
||||
|
||||
init_sched(pcpu_id);
|
||||
|
||||
setup_clos(pcpu_id);
|
||||
|
||||
enable_smep();
|
||||
|
@ -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)
|
||||
|
@ -39,7 +39,7 @@ bool is_idle_thread(const struct thread_object *obj);
|
||||
uint16_t sched_get_pcpuid(const struct thread_object *obj);
|
||||
struct thread_object *sched_get_current(uint16_t pcpu_id);
|
||||
|
||||
void init_scheduler(void);
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user