From fe2984a52dd7a86188d37eea919df80f867ff023 Mon Sep 17 00:00:00 2001 From: jiangguangming Date: Mon, 26 Dec 2022 18:00:51 +0800 Subject: [PATCH] esp_hw_support: support riscv call --- components/esp_hw_support/sleep_modes.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/esp_hw_support/sleep_modes.c b/components/esp_hw_support/sleep_modes.c index 067ef09a91..465965e267 100644 --- a/components/esp_hw_support/sleep_modes.c +++ b/components/esp_hw_support/sleep_modes.c @@ -222,9 +222,15 @@ static void __attribute__((section(".rtc.entry.text"))) esp_wake_stub_entry(void { #define _SYM2STR(s) # s #define SYM2STR(s) _SYM2STR(s) + +#ifdef __riscv + __asm__ __volatile__ ("call " SYM2STR(esp_wake_stub_start) "\n"); +#else // call4 has a larger effective addressing range (-524284 to 524288 bytes), // which is sufficient for instruction addressing in RTC fast memory. __asm__ __volatile__ ("call4 " SYM2STR(esp_wake_stub_start) "\n"); +#endif + } #endif // SOC_PM_SUPPORT_DEEPSLEEP_CHECK_STUB_ONLY