@@ -206,7 +206,7 @@ void vPortStartFirstTask( void )
206
206
{
207
207
__asm volatile (
208
208
" .syntax unified \n"
209
- " ldr r2, =pxCurrentTCB \n" /* Obtain location of pxCurrentTCB. */
209
+ " ldr r2, pxCurrentTCBConst1 \n" /* Obtain location of pxCurrentTCB. */
210
210
" ldr r3, [r2] \n"
211
211
" ldr r0, [r3] \n" /* The first item in pxCurrentTCB is the task top of stack. */
212
212
" adds r0, #32 \n" /* Discard everything up to r0. */
@@ -220,6 +220,8 @@ void vPortStartFirstTask( void )
220
220
" pop {r2} \n" /* Pop and discard XPSR. */
221
221
" cpsie i \n" /* The first task has its context and interrupts can be enabled. */
222
222
" bx r3 \n" /* Finally, jump to the user defined task code. */
223
+ " .align 4 \n"
224
+ "pxCurrentTCBConst1: .word pxCurrentTCB\n"
223
225
);
224
226
}
225
227
/*-----------------------------------------------------------*/
@@ -380,7 +382,7 @@ void xPortPendSVHandler( void )
380
382
" .syntax unified \n"
381
383
" mrs r0, psp \n"
382
384
" \n"
383
- " ldr r3, =pxCurrentTCB \n" /* Get the location of the current TCB. */
385
+ " ldr r3, pxCurrentTCBConst2 \n" /* Get the location of the current TCB. */
384
386
" ldr r2, [r3] \n"
385
387
" \n"
386
388
" subs r0, r0, #32 \n" /* Make space for the remaining low registers. */
@@ -450,6 +452,8 @@ void xPortPendSVHandler( void )
450
452
" ldmia r0!, {r4-r7} \n" /* Pop low registers. */
451
453
" \n"
452
454
" bx r3 \n"
455
+ " .align 4 \n"
456
+ "pxCurrentTCBConst2: .word pxCurrentTCB \n"
453
457
);
454
458
}
455
459
/*-----------------------------------------------------------*/
0 commit comments