From 1f9629da9ff26b91c8893f3566c9776d44b011c3 Mon Sep 17 00:00:00 2001 From: morris Date: Tue, 5 Jan 2021 15:11:43 +0800 Subject: [PATCH] hal: put cpu_ll_get_core_id to IRAM --- components/hal/esp32c3/include/hal/cpu_ll.h | 2 +- components/hal/esp32s3/include/hal/cpu_ll.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/hal/esp32c3/include/hal/cpu_ll.h b/components/hal/esp32c3/include/hal/cpu_ll.h index e819fff803..ce8062c561 100644 --- a/components/hal/esp32c3/include/hal/cpu_ll.h +++ b/components/hal/esp32c3/include/hal/cpu_ll.h @@ -30,7 +30,7 @@ extern "C" { #endif -static inline int cpu_ll_get_core_id(void) +static inline int IRAM_ATTR cpu_ll_get_core_id(void) { #if SOC_CPU_CORES_NUM == 1 return 0; // No need to check core ID on single core hardware diff --git a/components/hal/esp32s3/include/hal/cpu_ll.h b/components/hal/esp32s3/include/hal/cpu_ll.h index f43c65ef34..a7fb19625c 100644 --- a/components/hal/esp32s3/include/hal/cpu_ll.h +++ b/components/hal/esp32s3/include/hal/cpu_ll.h @@ -21,13 +21,14 @@ #include "xtensa/config/specreg.h" #include "xtensa/config/extreg.h" #include "esp_bit_defs.h" +#include "esp_attr.h" #include "xtensa/config/core.h" #ifdef __cplusplus extern "C" { #endif -static inline int cpu_ll_get_core_id(void) +static inline int IRAM_ATTR cpu_ll_get_core_id(void) { uint32_t id; asm volatile (