]> granicus.if.org Git - esp-idf/commitdiff
freertos: make sure xPortGetCoreID is placed into IRAM
authorIvan Grokhotkov <ivan@espressif.com>
Tue, 29 Aug 2017 00:25:41 +0000 (08:25 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Tue, 29 Aug 2017 00:31:36 +0000 (08:31 +0800)
In some cases, xPortGetCoreID was not inlined, and ended up in flash.
Since this function is used in many situations when cache is disabled,
that caused exceptions. Adding IRAM attribute to fix that.

components/freertos/include/freertos/portable.h
components/freertos/include/freertos/portmacro.h

index 45eaf73964b69ad8e2fe0227c33c7979a74fc43d..a628cf031a1be884bdf3750feb7d1135c5fb09a5 100644 (file)
@@ -197,7 +197,7 @@ BaseType_t xPortInIsrContext();
 #endif
 
 /* Multi-core: get current core ID */
-static inline uint32_t xPortGetCoreID() {
+static inline uint32_t IRAM_ATTR xPortGetCoreID() {
     int id;
     asm volatile(
         "rsr.prid %0\n"
index a909b329afdefdb7082cbbaa313baa9efe7d833e..b74766283552cd6570b0f51ee8f0bced5bef1c39 100644 (file)
@@ -121,6 +121,7 @@ typedef unsigned portBASE_TYPE      UBaseType_t;
 #include "portbenchmark.h"
 
 #include "sdkconfig.h"
+#include "esp_attr.h"
 
 #define portFIRST_TASK_HOOK CONFIG_FREERTOS_BREAK_ON_SCHEDULER_START_JTAG