mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-11-29 09:43:42 +00:00
hv: vcpu: Move launch_vcpu to common scope
Tracked-On: #8830 Signed-off-by: Yifan Liu <yifan1.liu@intel.com> Reviewed-by: Fei Li <fei1.li@intel.com> Acked-by: Wang Yu1 <yu1.wang@intel.com>
This commit is contained in:
@@ -910,21 +910,6 @@ void arch_context_switch_in(struct thread_object *next)
|
||||
rstore_xsave_area(vcpu, ectx);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @pre vcpu != NULL
|
||||
* @pre vcpu->state == VCPU_INIT
|
||||
*/
|
||||
void launch_vcpu(struct acrn_vcpu *vcpu)
|
||||
{
|
||||
uint16_t pcpu_id = pcpuid_from_vcpu(vcpu);
|
||||
|
||||
pr_dbg("vcpu%hu scheduled on pcpu%hu", vcpu->vcpu_id, pcpu_id);
|
||||
vcpu_set_state(vcpu, VCPU_RUNNING);
|
||||
wake_thread(&vcpu->thread_obj);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @pre vcpu != NULL
|
||||
*/
|
||||
|
||||
@@ -147,3 +147,14 @@ void destroy_vcpu(struct acrn_vcpu *vcpu)
|
||||
|
||||
vcpu_set_state(vcpu, VCPU_OFFLINE);
|
||||
}
|
||||
|
||||
void launch_vcpu(struct acrn_vcpu *vcpu)
|
||||
{
|
||||
uint16_t pcpu_id = pcpuid_from_vcpu(vcpu);
|
||||
|
||||
pr_dbg("vcpu%hu scheduled on pcpu%hu", vcpu->vcpu_id, pcpu_id);
|
||||
|
||||
vcpu_set_state(vcpu, VCPU_RUNNING);
|
||||
|
||||
wake_thread(&vcpu->thread_obj);
|
||||
}
|
||||
|
||||
@@ -571,17 +571,6 @@ void reset_vcpu(struct acrn_vcpu *vcpu, enum reset_mode mode);
|
||||
*/
|
||||
void zombie_vcpu(struct acrn_vcpu *vcpu, enum vcpu_state new_state);
|
||||
|
||||
/**
|
||||
* @brief set the vcpu to running state, then it will be scheculed.
|
||||
*
|
||||
* Adds a vCPU into the run queue and make a reschedule request for it. It sets the vCPU state to VCPU_RUNNING.
|
||||
*
|
||||
* @param[inout] vcpu pointer to vcpu data structure
|
||||
* @pre vcpu != NULL
|
||||
* @pre vcpu->state == VCPU_INIT
|
||||
*/
|
||||
void launch_vcpu(struct acrn_vcpu *vcpu);
|
||||
|
||||
/**
|
||||
* @brief kick the vcpu and let it handle pending events
|
||||
*
|
||||
|
||||
@@ -129,6 +129,17 @@ int32_t create_vcpu(struct acrn_vm *vm, uint16_t pcpu_id);
|
||||
*/
|
||||
void destroy_vcpu(struct acrn_vcpu *vcpu);
|
||||
|
||||
/**
|
||||
* @brief set the vcpu to running state, then it will be scheculed.
|
||||
*
|
||||
* Adds a vCPU into the run queue and make a reschedule request for it. It sets the vCPU state to VCPU_RUNNING.
|
||||
*
|
||||
* @param[inout] vcpu pointer to vcpu data structure
|
||||
* @pre vcpu != NULL
|
||||
* @pre vcpu->state == VCPU_INIT
|
||||
*/
|
||||
void launch_vcpu(struct acrn_vcpu *vcpu);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user