From 5ccf93d7889e7eb10660fa2426680cc64b8a75a7 Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Fri, 7 Apr 2023 18:55:44 +0800 Subject: [PATCH] bugfix: fix wrong RvCoreCriticalSleepFrame ptr value after wake restore --- components/esp_hw_support/sleep_cpu_asm.S | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/esp_hw_support/sleep_cpu_asm.S b/components/esp_hw_support/sleep_cpu_asm.S index c62756d889..3a24e917db 100644 --- a/components/esp_hw_support/sleep_cpu_asm.S +++ b/components/esp_hw_support/sleep_cpu_asm.S @@ -53,11 +53,12 @@ rv_core_critical_regs_save: sw t2, RV_SLP_CTX_T2(t0) sw s0, RV_SLP_CTX_S0(t0) sw s1, RV_SLP_CTX_S1(t0) - sw a0, RV_SLP_CTX_A0(t0) - /* !! WARNING, do not use the a0 register below, a0 carries important sleep - * information and will be returned as the return value !! */ + /* a0 is caller saved, so it does not need to be saved, but it should be the + pointer value of RvCoreCriticalSleepFrame for return. + */ mv a0, t0 + sw a0, RV_SLP_CTX_A0(t0) sw a1, RV_SLP_CTX_A1(t0) sw a2, RV_SLP_CTX_A2(t0)