hv: sched: add pcpu_id in sched_control

To get pcpu_id from sched_control quickly and easier.

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>
This commit is contained in:
Shuo A Liu 2019-06-17 11:30:13 +08:00 committed by wenlingz
parent 84e5a8e894
commit cad195c018
2 changed files with 2 additions and 0 deletions

View File

@ -54,6 +54,7 @@ void init_sched(uint16_t pcpu_id)
spinlock_init(&ctl->scheduler_lock); spinlock_init(&ctl->scheduler_lock);
ctl->flags = 0UL; ctl->flags = 0UL;
ctl->curr_obj = NULL; ctl->curr_obj = NULL;
ctl->pcpu_id = pcpu_id;
} }
void get_schedule_lock(uint16_t pcpu_id) void get_schedule_lock(uint16_t pcpu_id)

View File

@ -41,6 +41,7 @@ struct thread_object {
}; };
struct sched_control { struct sched_control {
uint16_t pcpu_id;
uint64_t flags; uint64_t flags;
struct thread_object *curr_obj; struct thread_object *curr_obj;
spinlock_t scheduler_lock; /* to protect sched_control and thread_object */ spinlock_t scheduler_lock; /* to protect sched_control and thread_object */