diff --git a/components/freertos/tasks.c b/components/freertos/tasks.c index bdf3712b7..6131892a6 100644 --- a/components/freertos/tasks.c +++ b/components/freertos/tasks.c @@ -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 diff --git a/components/freertos/xtensa_vectors.S b/components/freertos/xtensa_vectors.S index 57bfbe9f1..f0d874a59 100644 --- a/components/freertos/xtensa_vectors.S +++ b/components/freertos/xtensa_vectors.S @@ -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 */