From e595ae88d42a7d82d7fac53a2fa907b948813e4a Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Thu, 26 May 2022 14:37:56 +0800 Subject: [PATCH] HAL: place cpu_ll_get_cycle_count in IRAM Closes https://github.com/espressif/esp-idf/issues/9008 --- components/hal/esp32/include/hal/cpu_ll.h | 2 +- components/hal/esp32s2/include/hal/cpu_ll.h | 2 +- components/hal/esp32s3/include/hal/cpu_ll.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/hal/esp32/include/hal/cpu_ll.h b/components/hal/esp32/include/hal/cpu_ll.h index 49d2e3947d..68475e4ddf 100644 --- a/components/hal/esp32/include/hal/cpu_ll.h +++ b/components/hal/esp32/include/hal/cpu_ll.h @@ -39,7 +39,7 @@ static inline uint32_t IRAM_ATTR cpu_ll_get_core_id(void) return id; } -static inline uint32_t cpu_ll_get_cycle_count(void) +static inline uint32_t IRAM_ATTR cpu_ll_get_cycle_count(void) { uint32_t result; RSR(CCOUNT, result); diff --git a/components/hal/esp32s2/include/hal/cpu_ll.h b/components/hal/esp32s2/include/hal/cpu_ll.h index ded1ca3ab4..bb7bd9d735 100644 --- a/components/hal/esp32s2/include/hal/cpu_ll.h +++ b/components/hal/esp32s2/include/hal/cpu_ll.h @@ -33,7 +33,7 @@ static inline uint32_t IRAM_ATTR cpu_ll_get_core_id(void) return 0; } -static inline uint32_t cpu_ll_get_cycle_count(void) +static inline uint32_t IRAM_ATTR cpu_ll_get_cycle_count(void) { uint32_t result; RSR(CCOUNT, result); diff --git a/components/hal/esp32s3/include/hal/cpu_ll.h b/components/hal/esp32s3/include/hal/cpu_ll.h index 284e86757d..d22a32f288 100644 --- a/components/hal/esp32s3/include/hal/cpu_ll.h +++ b/components/hal/esp32s3/include/hal/cpu_ll.h @@ -38,7 +38,7 @@ static inline uint32_t IRAM_ATTR cpu_ll_get_core_id(void) return id; } -static inline uint32_t cpu_ll_get_cycle_count(void) +static inline uint32_t IRAM_ATTR cpu_ll_get_cycle_count(void) { uint32_t result; RSR(CCOUNT, result);