@@ -761,7 +761,7 @@ static void prvRestoreContextOfFirstTask( void )
761761 " msr msp, r0 \n" /* Set the msp back to the start of the stack. */
762762 " \n"
763763 /*------------ Program MPU. ------------ */
764- " ldr r3, pxCurrentTCBConst2 \n" /* r3 = pxCurrentTCBConst2 . */
764+ " ldr r3, =pxCurrentTCB \n" /* r3 = =pxCurrentTCB . */
765765 " ldr r2, [r3] \n" /* r2 = pxCurrentTCB. */
766766 " add r2, r2, #4 \n" /* r2 = Second item in the TCB which is xMPUSettings. */
767767 " \n"
@@ -789,7 +789,7 @@ static void prvRestoreContextOfFirstTask( void )
789789 " dsb \n" /* Force memory writes before continuing. */
790790 " \n"
791791 /*---------- Restore Context. ---------- */
792- " ldr r3, pxCurrentTCBConst2 \n" /* r3 = pxCurrentTCBConst2 . */
792+ " ldr r3, =pxCurrentTCB \n" /* r3 = =pxCurrentTCB . */
793793 " ldr r2, [r3] \n" /* r2 = pxCurrentTCB. */
794794 " ldr r1, [r2] \n" /* r1 = Location of saved context in TCB. */
795795 " \n"
@@ -805,8 +805,6 @@ static void prvRestoreContextOfFirstTask( void )
805805 " bx lr \n"
806806 " \n"
807807 " .ltorg \n" /* Assemble current literal pool to avoid offset-out-of-bound errors with lto. */
808- " .align 4 \n"
809- " pxCurrentTCBConst2: .word pxCurrentTCB\n"
810808 );
811809}
812810/*-----------------------------------------------------------*/
@@ -1084,7 +1082,7 @@ void xPortPendSVHandler( void )
10841082
10851083 __asm volatile
10861084 (
1087- " ldr r3, pxCurrentTCBConst \n" /* r3 = pxCurrentTCBConst . */
1085+ " ldr r3, =pxCurrentTCB \n" /* r3 = =pxCurrentTCB . */
10881086 " ldr r2, [r3] \n" /* r2 = pxCurrentTCB. */
10891087 " ldr r1, [r2] \n" /* r1 = Location where the context should be saved. */
10901088 " \n"
@@ -1122,7 +1120,7 @@ void xPortPendSVHandler( void )
11221120 " msr basepri, r0 \n"
11231121 " \n"
11241122 /*------------ Program MPU. ------------ */
1125- " ldr r3, pxCurrentTCBConst \n" /* r3 = pxCurrentTCBConst . */
1123+ " ldr r3, =pxCurrentTCB \n" /* r3 = =pxCurrentTCB . */
11261124 " ldr r2, [r3] \n" /* r2 = pxCurrentTCB. */
11271125 " add r2, r2, #4 \n" /* r2 = Second item in the TCB which is xMPUSettings. */
11281126 " \n"
@@ -1150,7 +1148,7 @@ void xPortPendSVHandler( void )
11501148 " dsb \n" /* Force memory writes before continuing. */
11511149 " \n"
11521150 /*---------- Restore Context. ---------- */
1153- " ldr r3, pxCurrentTCBConst \n" /* r3 = pxCurrentTCBConst . */
1151+ " ldr r3, =pxCurrentTCB \n" /* r3 = =pxCurrentTCB . */
11541152 " ldr r2, [r3] \n" /* r2 = pxCurrentTCB. */
11551153 " ldr r1, [r2] \n" /* r1 = Location of saved context in TCB. */
11561154 " \n"
@@ -1170,8 +1168,6 @@ void xPortPendSVHandler( void )
11701168 " bx lr \n"
11711169 " \n"
11721170 " .ltorg \n" /* Assemble the current literal pool to avoid offset-out-of-bound errors with lto. */
1173- " .align 4 \n"
1174- " pxCurrentTCBConst: .word pxCurrentTCB \n"
11751171 ::"i " ( configMAX_SYSCALL_INTERRUPT_PRIORITY )
11761172 );
11771173}
@@ -1349,8 +1345,6 @@ BaseType_t xIsPrivileged( void ) /* __attribute__ (( naked )) */
13491345 " movne r0, #0 \n" /* CONTROL[0]!=0. Return false to indicate that the processor is not privileged. */
13501346 " moveq r0, #1 \n" /* CONTROL[0]==0. Return true to indicate that the processor is privileged. */
13511347 " bx lr \n" /* Return. */
1352- " \n"
1353- " .align 4 \n"
13541348 ::: "r0" , "memory"
13551349 );
13561350}
0 commit comments