]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/portable/IAR/ARM_CA5_No_GIC/portASM.s
Update version number to 9.0.0rc2.
[freertos] / FreeRTOS / Source / portable / IAR / ARM_CA5_No_GIC / portASM.s
index c66146964e3981eb5de7f63e48a2687a4b3ca5cd..e07cd05b8e192a312c427e29f0f3713d04bcbcc2 100644 (file)
@@ -1,5 +1,5 @@
 ;/*\r
-;    FreeRTOS V8.0.1 - Copyright (C) 2014 Real Time Engineers Ltd.\r
+;    FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd.\r
 ;    All rights reserved\r
 ;\r
 ;\r
@@ -58,6 +58,7 @@
        EXTERN  vTaskSwitchContext\r
        EXTERN  ulPortYieldRequired\r
        EXTERN  ulPortInterruptNesting\r
+       EXTERN  vApplicationIRQHandler\r
 \r
        PUBLIC  FreeRTOS_SWI_Handler\r
        PUBLIC  FreeRTOS_IRQ_Handler\r
@@ -73,7 +74,7 @@ IRQ_MODE                      EQU             0x12
        INCLUDE portASM.h\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
@@ -83,16 +84,26 @@ FreeRTOS_SWI_Handler
        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
-       portRESTORE_CONTEXT\r
 \r
+       PRESERVE8\r
+\r
+       ; Switch to system mode\r
+       CPS             #SYS_MODE\r
+       portRESTORE_CONTEXT\r
 \r
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
 ; IRQ interrupt handler used when individual priorities cannot be masked\r
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
 FreeRTOS_IRQ_Handler\r
 \r
+       PRESERVE8\r
+\r
        ; Return to the interrupted instruction.\r
        SUB             lr, lr, #4\r
 \r
@@ -121,25 +132,24 @@ FreeRTOS_IRQ_Handler
        AND             r2, r2, #4\r
        SUB             sp, sp, r2\r
 \r
-       ; Call the interrupt handler\r
        PUSH    {r0-r3, lr}\r
-       LDR             r1, =configINTERRUPT_VECTOR_ADDRESS\r
-       LDR             r0, [r1]\r
-       STR             r1, [r1] ; Write to IVR in case protect mode is being used.\r
+\r
+       ; Call the port part specific handler.\r
+       LDR             r0, =vApplicationIRQHandler\r
        BLX             r0\r
        POP             {r0-r3, lr}\r
        ADD             sp, sp, r2\r
 \r
        CPSID   i\r
 \r
-       ; Write to the EOI register\r
+       ; Write to the EOI register.\r
        LDR     r4, =configEOI_ADDRESS\r
        STR             r0, [r4]\r
 \r
        ; Restore the old nesting count\r
        STR             r1, [r3]\r
 \r
-       ; A context switch is never performed if the nesting count is not 0\r
+       ; A context switch is never performed if the nesting count is not 0.\r
        CMP             r1, #0\r
        BNE             exit_without_switch\r
 \r
@@ -186,7 +196,6 @@ switch_before_exit
        ; Restore the context of, and branch to, the task selected to execute next.\r
        portRESTORE_CONTEXT\r
 \r
-\r
        END\r
 \r
 \r