imajeff wrote on Thursday, August 04, 2005:
So far, it appears to be a compiler error.
It is getting 0 for pxCurrentTCB->uxPriority for all my tasks, when the two I added should be 1. Maybe mixing up with the frame-pointer optimization. I compile with -fomit-frame-pointer, so I should try it with the frame pointer.
Some segments where the error is:
signed portBASE_TYPE xTaskCreate( pdTASK_CODE pvTaskCode, const signed portCHAR * const pcName, unsigned portSHORT usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, xTaskHandle *pxCreatedTask )
{
4385: 1b 9b leas -5,SP
4387: 18 01 ae 12 movw 121a <_.d1>, 2,-SP
438b: 1a
438c: 6c 82 std 2,SP
438e: 18 05 8b 12 movw 11,SP, 121a <_.d1>
4392: 1a
00004393 <.LM2>:
signed portBASE_TYPE xReturn;
tskTCB * pxNewTCB;
static unsigned portBASE_TYPE uxTaskNumber = 0; /*lint !e956 Static is deliberate - this is guarded before use. */
/* Allocate the memory required by the TCB and stack for the new task.
checking that the allocation was successful. */
pxNewTCB = prvAllocateTCBAndStack( usStackDepth );
4393: fc 12 1a ldd 121a <_.d1>
4396: 16 4b 7c jsr 4b7c <prvAllocateTCBAndStack>
4399: 6c 84 std 4,SP
0000439b <.LM3>:
if( pxNewTCB != NULL )
439b: 18 27 00 b8 lbeq 4457 <.LM22>
0000439f <.LM4>:
{
portSTACK_TYPE *pxTopOfStack;
/* Setup the newly allocated TCB with the initial state of the task. */
prvInitialiseTCBVariables( pxNewTCB, usStackDepth, pcName, uxPriority );
439f: e6 f0 10 ldab 16,SP
000043a2 <.LBB3>:
43a2: 37 pshb
43a3: 1b 9f des
43a5: 18 02 8b ae movw 11,SP, 2,-SP
43a9: 18 01 ae 12 movw 121a <_.d1>, 2,-SP
43ad: 1a
43ae: ec 8a ldd 10,SP
43b0: 16 4a 8c jsr 4a8c <prvInitialiseTCBVariables>
====
static void prvInitialiseTCBVariables( tskTCB *pxTCB, unsigned portSHORT usStackDepth, const signed portCHAR * const pcName, unsigned portBASE_TYPE uxPriority )
{
4a8c: 1b 9a leas -6,SP
4a8e: 6c 80 std 0,SP
00004a90 <.LM213>:
pxTCB->usStackDepth = usStackDepth;
4a90: ec 88 ldd 8,SP
4a92: ee 80 ldx 0,SP
4a94: 6c e0 1b std 27,X
====