mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
Merge branch 'feat/riscv-spiram-stack-pointer-update-before-restart_v5.5' into 'release/v5.5'
fix(esp_system): fix PSRAM stack crash in esp_restart_noos on RISC-V SPIRAM chips (v5.5) See merge request espressif/esp-idf!48068
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2020-2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -101,6 +101,17 @@ FORCE_INLINE_ATTR void *rv_utils_get_sp(void)
|
||||
return sp;
|
||||
}
|
||||
|
||||
/* Switch the stack pointer to a new address.
|
||||
*
|
||||
* Unlike the Xtensa SET_STACK, no window register management is required on
|
||||
* RISC-V; a plain register move is sufficient. The "memory" clobber prevents
|
||||
* the compiler from reordering any accesses across the switch.
|
||||
*/
|
||||
FORCE_INLINE_ATTR void rv_utils_set_sp(void *new_sp)
|
||||
{
|
||||
asm volatile ("mv sp, %0" :: "r"(new_sp) : "memory");
|
||||
}
|
||||
|
||||
FORCE_INLINE_ATTR uint32_t __attribute__((always_inline)) rv_utils_get_cycle_count(void)
|
||||
{
|
||||
#if !SOC_CPU_HAS_CSR_PC
|
||||
|
||||
Reference in New Issue
Block a user