From ce9375874c12978175833ea146038fd42a5f7398 Mon Sep 17 00:00:00 2001 From: Yin Fengwei Date: Fri, 6 Sep 2019 11:23:42 +0800 Subject: [PATCH] hv: pm: correct the function name do_acpi_s3 actually not limit to do s3 operation. It depends on the paramters pm1a_cnt_val and pm1b_cnt_val. It could be s3/s5. Update the function name from xx_s3 to xx_sx. Tracked-On: #3564 Signed-off-by: Yin Fengwei Acked-by: Eddie Dong --- hypervisor/arch/x86/pm.c | 3 ++- hypervisor/arch/x86/wakeup.S | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hypervisor/arch/x86/pm.c b/hypervisor/arch/x86/pm.c index 2b3fa7ffd..d86bd9d7f 100644 --- a/hypervisor/arch/x86/pm.c +++ b/hypervisor/arch/x86/pm.c @@ -119,7 +119,8 @@ static uint32_t acpi_gas_read(const struct acpi_generic_address *gas) return ret; } -void do_acpi_s3(struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val) +/* 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) { uint32_t s1, s2; diff --git a/hypervisor/arch/x86/wakeup.S b/hypervisor/arch/x86/wakeup.S index 5cab6fa7f..1af674d1d 100644 --- a/hypervisor/arch/x86/wakeup.S +++ b/hypervisor/arch/x86/wakeup.S @@ -25,7 +25,7 @@ .extern restore_msrs .extern cpu_ctx .extern load_gdtr_and_tr - .extern do_acpi_s3 + .extern do_acpi_sx .global asm_enter_s3 asm_enter_s3: @@ -94,7 +94,7 @@ asm_enter_s3: /*48U=0x30=CPU_CONTEXT_OFFSET_RSI*/ movq 0x30 + cpu_ctx(%rip), %rsi /* pm1a_cnt_val */ - call do_acpi_s3 + call do_acpi_sx /* * When system resume from S3, trampoline_start64 will