From 537f8022602aff2287c5cee60da983c7f89838ac 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 7a83ddbc43..3de6460c36 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 c70955eba2..ea4556adb5 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 8445fdf44c..32f607854b 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);