;/*\r
-; FreeRTOS V7.4.2 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+; FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd.\r
+; All rights reserved\r
;\r
;\r
; ***************************************************************************\r
\r
\r
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
-; SVC handler is used to start the scheduler and yield a task.\r
+; SVC handler is used to yield a task.\r
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
FreeRTOS_SWI_Handler\r
\r
portSAVE_CONTEXT\r
LDR R0, =vTaskSwitchContext\r
BLX R0\r
+ portRESTORE_CONTEXT\r
\r
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
+; vPortRestoreTaskContext is used to start the scheduler.\r
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
vPortRestoreTaskContext\r
+ ; Switch to system mode\r
+ CPS #SYS_MODE\r
portRESTORE_CONTEXT\r
\r
-\r
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
; PL390 GIC interrupt handler\r
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
\r
; Call the interrupt handler\r
PUSH {r0-r3, lr}\r
- BL vApplicationIRQHandler\r
+ LDR r1, =vApplicationIRQHandler\r
+ BLX r1\r
POP {r0-r3, lr}\r
ADD sp, sp, r2\r
\r
CPSID i\r
- \r
+\r
; Write the value read from ICCIAR to ICCEOIR\r
LDR r4, =ulICCEOIR\r
STR r0, [r4]\r
; vTaskSwitchContext() if vTaskSwitchContext() uses LDRD or STRD\r
; instructions, or 8 byte aligned stack allocated data. LR does not need\r
; saving as a new LR will be loaded by portRESTORE_CONTEXT anyway.\r
- BL vTaskSwitchContext\r
+ LDR r0, =vTaskSwitchContext\r
+ BLX r0\r
\r
; Restore the context of, and branch to, the task selected to execute next.\r
portRESTORE_CONTEXT\r