]> granicus.if.org Git - esp-idf/commitdiff
Define xcoreid offset, add warning in tcb struct wrt the need to also change that...
authorJeroen Domburg <git@j0h.nl>
Thu, 29 Sep 2016 03:07:18 +0000 (11:07 +0800)
committerJeroen Domburg <git@j0h.nl>
Thu, 29 Sep 2016 03:07:18 +0000 (11:07 +0800)
components/freertos/tasks.c
components/freertos/xtensa_vectors.S

index bdf3712b7d01ee6b2765caba6021ea91fd56f791..6131892a6571e86f6595de655e03db211ec719b2 100644 (file)
@@ -157,7 +157,7 @@ typedef struct tskTaskControlBlock
        StackType_t                     *pxStack;                       /*< Points to the start of the stack. */
        char                            pcTaskName[ configMAX_TASK_NAME_LEN ];/*< Descriptive name given to the task when created.  Facilitates debugging only. */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
        BaseType_t                      xCoreID;                        /*< Core this task is pinned to */
-
+                                                                                       /* If this moves around (other than pcTaskName size changes), please change the define in xtensa_vectors.S as well. */
        #if ( portSTACK_GROWTH > 0 )
                StackType_t             *pxEndOfStack;          /*< Points to the end of the stack on architectures where the stack grows up from low memory. */
        #endif
index 57bfbe9f1e42f2bc3d4aba1749954709f03a31fd..f0d874a59c2ba7e99c07025861c0ac0c9a024617 100644 (file)
@@ -92,6 +92,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include "xtensa_rtos.h"
 
+/*
+  Define for workaround: pin no-cpu-affinity tasks to a cpu when fpu is used.
+  Please change this when the tcb structure is changed
+*/
+#define TASKTCB_XCOREID_OFFSET (0x3C+configMAX_TASK_NAME_LEN+3)&~3
 .extern pxCurrentTCB
 
 /* Enable stack backtrace across exception/interrupt - see below */
@@ -902,7 +907,7 @@ _xt_coproc_exc:
     slli    a3,  a3, 2
     add     a2,  a2, a3
     l32i    a2, a2, 0                       /* a2 = start of pxCurrentTCB[cpuid] */
-    addi    a2, a2, (0x3C+configMAX_TASK_NAME_LEN+3)&~3 /* offset to xCoreID in tcb struct */
+    addi    a2, a2, TASKTCB_XCOREID_OFFSET  /* offset to xCoreID in tcb struct */
     getcoreid a3
     s32i    a3, a2, 0                       /* store current cpuid */