|
|
@ -761,7 +761,7 @@ static void prvRestoreContextOfFirstTask( void )
|
|
|
|
" msr msp, r0 \n" /* Set the msp back to the start of the stack. */
|
|
|
|
" msr msp, r0 \n" /* Set the msp back to the start of the stack. */
|
|
|
|
" \n"
|
|
|
|
" \n"
|
|
|
|
/*------------ Program MPU. ------------ */
|
|
|
|
/*------------ Program MPU. ------------ */
|
|
|
|
" ldr r3, pxCurrentTCBConst2 \n" /* r3 = pxCurrentTCBConst2. */
|
|
|
|
" ldr r3, =pxCurrentTCB \n" /* r3 = =pxCurrentTCB. */
|
|
|
|
" ldr r2, [r3] \n" /* r2 = pxCurrentTCB. */
|
|
|
|
" ldr r2, [r3] \n" /* r2 = pxCurrentTCB. */
|
|
|
|
" add r2, r2, #4 \n" /* r2 = Second item in the TCB which is xMPUSettings. */
|
|
|
|
" add r2, r2, #4 \n" /* r2 = Second item in the TCB which is xMPUSettings. */
|
|
|
|
" \n"
|
|
|
|
" \n"
|
|
|
@ -789,7 +789,7 @@ static void prvRestoreContextOfFirstTask( void )
|
|
|
|
" dsb \n" /* Force memory writes before continuing. */
|
|
|
|
" dsb \n" /* Force memory writes before continuing. */
|
|
|
|
" \n"
|
|
|
|
" \n"
|
|
|
|
/*---------- Restore Context. ---------- */
|
|
|
|
/*---------- Restore Context. ---------- */
|
|
|
|
" ldr r3, pxCurrentTCBConst2 \n" /* r3 = pxCurrentTCBConst2. */
|
|
|
|
" ldr r3, =pxCurrentTCB \n" /* r3 = =pxCurrentTCB. */
|
|
|
|
" ldr r2, [r3] \n" /* r2 = pxCurrentTCB. */
|
|
|
|
" ldr r2, [r3] \n" /* r2 = pxCurrentTCB. */
|
|
|
|
" ldr r1, [r2] \n" /* r1 = Location of saved context in TCB. */
|
|
|
|
" ldr r1, [r2] \n" /* r1 = Location of saved context in TCB. */
|
|
|
|
" \n"
|
|
|
|
" \n"
|
|
|
@ -805,8 +805,6 @@ static void prvRestoreContextOfFirstTask( void )
|
|
|
|
" bx lr \n"
|
|
|
|
" bx lr \n"
|
|
|
|
" \n"
|
|
|
|
" \n"
|
|
|
|
" .ltorg \n" /* Assemble current literal pool to avoid offset-out-of-bound errors with lto. */
|
|
|
|
" .ltorg \n" /* Assemble current literal pool to avoid offset-out-of-bound errors with lto. */
|
|
|
|
" .align 4 \n"
|
|
|
|
|
|
|
|
" pxCurrentTCBConst2: .word pxCurrentTCB\n"
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*-----------------------------------------------------------*/
|
|
|
|
/*-----------------------------------------------------------*/
|
|
|
@ -1084,7 +1082,7 @@ void xPortPendSVHandler( void )
|
|
|
|
|
|
|
|
|
|
|
|
__asm volatile
|
|
|
|
__asm volatile
|
|
|
|
(
|
|
|
|
(
|
|
|
|
" ldr r3, pxCurrentTCBConst \n" /* r3 = pxCurrentTCBConst. */
|
|
|
|
" ldr r3, =pxCurrentTCB \n" /* r3 = =pxCurrentTCB. */
|
|
|
|
" ldr r2, [r3] \n" /* r2 = pxCurrentTCB. */
|
|
|
|
" ldr r2, [r3] \n" /* r2 = pxCurrentTCB. */
|
|
|
|
" ldr r1, [r2] \n" /* r1 = Location where the context should be saved. */
|
|
|
|
" ldr r1, [r2] \n" /* r1 = Location where the context should be saved. */
|
|
|
|
" \n"
|
|
|
|
" \n"
|
|
|
@ -1122,7 +1120,7 @@ void xPortPendSVHandler( void )
|
|
|
|
" msr basepri, r0 \n"
|
|
|
|
" msr basepri, r0 \n"
|
|
|
|
" \n"
|
|
|
|
" \n"
|
|
|
|
/*------------ Program MPU. ------------ */
|
|
|
|
/*------------ Program MPU. ------------ */
|
|
|
|
" ldr r3, pxCurrentTCBConst \n" /* r3 = pxCurrentTCBConst. */
|
|
|
|
" ldr r3, =pxCurrentTCB \n" /* r3 = =pxCurrentTCB. */
|
|
|
|
" ldr r2, [r3] \n" /* r2 = pxCurrentTCB. */
|
|
|
|
" ldr r2, [r3] \n" /* r2 = pxCurrentTCB. */
|
|
|
|
" add r2, r2, #4 \n" /* r2 = Second item in the TCB which is xMPUSettings. */
|
|
|
|
" add r2, r2, #4 \n" /* r2 = Second item in the TCB which is xMPUSettings. */
|
|
|
|
" \n"
|
|
|
|
" \n"
|
|
|
@ -1150,7 +1148,7 @@ void xPortPendSVHandler( void )
|
|
|
|
" dsb \n" /* Force memory writes before continuing. */
|
|
|
|
" dsb \n" /* Force memory writes before continuing. */
|
|
|
|
" \n"
|
|
|
|
" \n"
|
|
|
|
/*---------- Restore Context. ---------- */
|
|
|
|
/*---------- Restore Context. ---------- */
|
|
|
|
" ldr r3, pxCurrentTCBConst \n" /* r3 = pxCurrentTCBConst. */
|
|
|
|
" ldr r3, =pxCurrentTCB \n" /* r3 = =pxCurrentTCB. */
|
|
|
|
" ldr r2, [r3] \n" /* r2 = pxCurrentTCB. */
|
|
|
|
" ldr r2, [r3] \n" /* r2 = pxCurrentTCB. */
|
|
|
|
" ldr r1, [r2] \n" /* r1 = Location of saved context in TCB. */
|
|
|
|
" ldr r1, [r2] \n" /* r1 = Location of saved context in TCB. */
|
|
|
|
" \n"
|
|
|
|
" \n"
|
|
|
@ -1170,8 +1168,6 @@ void xPortPendSVHandler( void )
|
|
|
|
" bx lr \n"
|
|
|
|
" bx lr \n"
|
|
|
|
" \n"
|
|
|
|
" \n"
|
|
|
|
" .ltorg \n" /* Assemble the current literal pool to avoid offset-out-of-bound errors with lto. */
|
|
|
|
" .ltorg \n" /* Assemble the current literal pool to avoid offset-out-of-bound errors with lto. */
|
|
|
|
" .align 4 \n"
|
|
|
|
|
|
|
|
" pxCurrentTCBConst: .word pxCurrentTCB \n"
|
|
|
|
|
|
|
|
::"i" ( configMAX_SYSCALL_INTERRUPT_PRIORITY )
|
|
|
|
::"i" ( configMAX_SYSCALL_INTERRUPT_PRIORITY )
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1349,8 +1345,6 @@ BaseType_t xIsPrivileged( void ) /* __attribute__ (( naked )) */
|
|
|
|
" movne r0, #0 \n" /* CONTROL[0]!=0. Return false to indicate that the processor is not privileged. */
|
|
|
|
" movne r0, #0 \n" /* CONTROL[0]!=0. Return false to indicate that the processor is not privileged. */
|
|
|
|
" moveq r0, #1 \n" /* CONTROL[0]==0. Return true to indicate that the processor is privileged. */
|
|
|
|
" moveq r0, #1 \n" /* CONTROL[0]==0. Return true to indicate that the processor is privileged. */
|
|
|
|
" bx lr \n" /* Return. */
|
|
|
|
" bx lr \n" /* Return. */
|
|
|
|
" \n"
|
|
|
|
|
|
|
|
" .align 4 \n"
|
|
|
|
|
|
|
|
::: "r0", "memory"
|
|
|
|
::: "r0", "memory"
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|