mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-06 16:15:00 +00:00
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:
committed by
ACRN System Integration
parent
89f53a409a
commit
837e4d8788
@@ -247,7 +247,7 @@ struct acrn_vcpu {
|
||||
volatile enum vcpu_state prev_state;
|
||||
volatile enum vcpu_state state; /* State of this VCPU */
|
||||
|
||||
struct sched_object sched_obj;
|
||||
struct thread_object thread_obj;
|
||||
bool launched; /* Whether the vcpu is launched on target pcpu */
|
||||
volatile bool running; /* vcpu is picked up and run? */
|
||||
|
||||
@@ -286,8 +286,8 @@ vcpu_vlapic(struct acrn_vcpu *vcpu)
|
||||
return &(vcpu->arch.vlapic);
|
||||
}
|
||||
|
||||
void default_idle(__unused struct sched_object *obj);
|
||||
void vcpu_thread(struct sched_object *obj);
|
||||
void default_idle(__unused struct thread_object *obj);
|
||||
void vcpu_thread(struct thread_object *obj);
|
||||
|
||||
int32_t vmx_vmrun(struct run_context *context, int32_t ops, int32_t ibrs);
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ struct per_cpu_region {
|
||||
struct stack_canary stk_canary;
|
||||
#endif
|
||||
struct per_cpu_timers cpu_timers;
|
||||
struct sched_context sched_ctx;
|
||||
struct sched_object idle;
|
||||
struct sched_control sched_ctl;
|
||||
struct thread_object idle;
|
||||
struct host_gdt gdt;
|
||||
struct tss_64 tss;
|
||||
enum pcpu_boot_state boot_state;
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user