hv: sched: rename schedule related structs and vars

prepare_switch_out -> switch_out
prepare_switch_in -> switch_in
prepare_switch -> do_switch
run_thread_t -> thread_entry_t
sched_object -> thread_object
sched_object.thread -> thread_object.thread_entry
sched_obj -> thread_obj
sched_context -> sched_control
sched_ctx -> sched_ctl

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:
Shuo A Liu
2019-05-23 16:17:28 +08:00
committed by ACRN System Integration
parent 89f53a409a
commit 837e4d8788
7 changed files with 86 additions and 86 deletions

View File

@@ -13,38 +13,38 @@
#define DEL_MODE_INIT (1U)
#define DEL_MODE_IPI (2U)
struct sched_object;
typedef void (*run_thread_t)(struct sched_object *obj);
typedef void (*prepare_switch_t)(struct sched_object *obj);
struct sched_object {
struct thread_object;
typedef void (*thread_entry_t)(struct thread_object *obj);
typedef void (*switch_t)(struct thread_object *obj);
struct thread_object {
char name[16];
struct list_head run_list;
uint64_t host_sp;
run_thread_t thread;
prepare_switch_t prepare_switch_out;
prepare_switch_t prepare_switch_in;
thread_entry_t thread_entry;
switch_t switch_out;
switch_t switch_in;
};
struct sched_context {
struct sched_control {
struct list_head runqueue;
uint64_t flags;
struct sched_object *curr_obj;
spinlock_t scheduler_lock; /* to protect sched_context and sched_object */
struct thread_object *curr_obj;
spinlock_t scheduler_lock; /* to protect sched_control and thread_object */
};
void init_scheduler(void);
void switch_to_idle(run_thread_t idle_thread);
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);
void add_to_cpu_runqueue(struct sched_object *obj, uint16_t pcpu_id);
void remove_from_cpu_runqueue(struct sched_object *obj);
void add_to_cpu_runqueue(struct thread_object *obj, uint16_t pcpu_id);
void remove_from_cpu_runqueue(struct thread_object *obj);
void make_reschedule_request(uint16_t pcpu_id, uint16_t delmode);
bool need_reschedule(uint16_t pcpu_id);
void schedule(void);
void run_sched_thread(struct sched_object *obj);
void run_sched_thread(struct thread_object *obj);
void arch_switch_to(void *prev_sp, void *next_sp);
#endif /* SCHEDULE_H */