mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-07-16 08:26:41 +00:00
hv: pm: fix coding style issue
This patch fix the coding style issue introduced by previous two patches. Tracked-On: #3564 Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
parent
f039d75998
commit
6b6aa80600
@ -149,7 +149,7 @@ static bool pm1ab_io_read(struct acrn_vcpu *vcpu, uint16_t addr, size_t width)
|
||||
return true;
|
||||
}
|
||||
|
||||
#define POWEROFF_TIMEOUT (5 * 60U) /* default poweroff timeout is 5 minutes */
|
||||
#define POWEROFF_TIMEOUT (300U) /* default poweroff timeout is 5 minutes */
|
||||
/* wait for other vm shutdown done. If POWEROFF_TIMEOUT passed and there are
|
||||
* still some VMs active, we will force platform power off.
|
||||
*
|
||||
@ -157,11 +157,11 @@ static bool pm1ab_io_read(struct acrn_vcpu *vcpu, uint16_t addr, size_t width)
|
||||
* - Let user configure whether we wait for ever till all VMs powered off or
|
||||
* force shutdown once pre-defined timeout hit.
|
||||
*/
|
||||
static inline void wait_for_other_vm_shutdown(struct acrn_vm *self_vm)
|
||||
static inline void wait_for_other_vm_shutdown(const struct acrn_vm *self_vm)
|
||||
{
|
||||
uint16_t vm_id;
|
||||
bool ready_for_s5;
|
||||
uint32_t timeout = POWEROFF_TIMEOUT;
|
||||
uint32_t timeout = (uint32_t)POWEROFF_TIMEOUT;
|
||||
struct acrn_vm *vm;
|
||||
|
||||
while (timeout != 0U) {
|
||||
@ -169,7 +169,7 @@ static inline void wait_for_other_vm_shutdown(struct acrn_vm *self_vm)
|
||||
for (vm_id = 0U; vm_id < CONFIG_MAX_VM_NUM; vm_id++) {
|
||||
vm = get_vm_from_vmid(vm_id);
|
||||
|
||||
if ((vm != self_vm) && !is_poweroff_vm(vm)) {
|
||||
if ((vm != self_vm) && (!is_poweroff_vm(vm))) {
|
||||
ready_for_s5 = false;
|
||||
}
|
||||
}
|
||||
@ -184,9 +184,10 @@ static inline void wait_for_other_vm_shutdown(struct acrn_vm *self_vm)
|
||||
}
|
||||
}
|
||||
|
||||
static inline void enter_s5(struct acrn_vm *vm, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val)
|
||||
static inline void enter_s5(const struct acrn_vm *vm, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val)
|
||||
{
|
||||
wait_for_other_vm_shutdown(vm);
|
||||
pr_err("yfwyfw: before enter s5");
|
||||
host_enter_s5(vm->pm.sx_state_data, pm1a_cnt_val, pm1b_cnt_val);
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ static uint32_t acpi_gas_read(const struct acpi_generic_address *gas)
|
||||
}
|
||||
|
||||
/* This function supports enter S3 or S5 according to the value given to pm1a_cnt_val and pm1b_cnt_val */
|
||||
void do_acpi_sx(struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val)
|
||||
void do_acpi_sx(const struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val)
|
||||
{
|
||||
uint32_t s1, s2;
|
||||
|
||||
@ -148,12 +148,12 @@ void do_acpi_sx(struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint
|
||||
} while ((s1 & (1U << BIT_WAK_STS)) == 0U);
|
||||
}
|
||||
|
||||
void host_enter_s5(struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val)
|
||||
void host_enter_s5(const struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val)
|
||||
{
|
||||
do_acpi_sx(sstate_data, pm1a_cnt_val, pm1b_cnt_val);
|
||||
}
|
||||
|
||||
void host_enter_s3(struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val)
|
||||
void host_enter_s3(const struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val)
|
||||
{
|
||||
uint64_t pmain_entry_saved;
|
||||
|
||||
|
@ -30,9 +30,10 @@ struct acpi_reset_reg {
|
||||
};
|
||||
|
||||
struct pm_s_state_data *get_host_sstate_data(void);
|
||||
void host_enter_s3(struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val);
|
||||
void host_enter_s5(struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val);
|
||||
extern void asm_enter_s3(struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val);
|
||||
void host_enter_s3(const struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val);
|
||||
void host_enter_s5(const struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val);
|
||||
void do_acpi_sx(const struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val);
|
||||
extern void asm_enter_s3(const struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val);
|
||||
extern void restore_s3_context(void);
|
||||
struct cpu_state_info *get_cpu_pm_state_info(void);
|
||||
struct acpi_reset_reg *get_host_reset_reg_data(void);
|
||||
|
Loading…
Reference in New Issue
Block a user