From 415ab25a496a0b39e84b1d909267b4d666ce1e77 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 6b853cdbe7..bc0e2a9820 100644 --- a/components/hal/esp32/include/hal/cpu_ll.h +++ b/components/hal/esp32/include/hal/cpu_ll.h @@ -31,7 +31,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 131d5e5823..bfb9ce5e3b 100644 --- a/components/hal/esp32s2/include/hal/cpu_ll.h +++ b/components/hal/esp32s2/include/hal/cpu_ll.h @@ -26,7 +26,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 c383a8b445..92b1daf4b2 100644 --- a/components/hal/esp32s3/include/hal/cpu_ll.h +++ b/components/hal/esp32s3/include/hal/cpu_ll.h @@ -30,7 +30,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);