]> git.sur5r.net Git - freertos/blob - Source/portable/IAR/AtmelSAM9XE/portasm.s79
Start to re-arrange files to include FreeRTOS+ in main download.
[freertos] / Source / portable / IAR / AtmelSAM9XE / portasm.s79
1                 RSEG ICODE:CODE\r
2                 CODE32\r
3 \r
4         EXTERN vTaskSwitchContext\r
5 \r
6         PUBLIC vPortYieldProcessor\r
7         PUBLIC vPortStartFirstTask\r
8 \r
9 #include "ISR_Support.h"\r
10 \r
11 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
12 ; Starting the first task is just a matter of restoring the context that\r
13 ; was created by pxPortInitialiseStack().\r
14 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
15 vPortStartFirstTask:\r
16         portRESTORE_CONTEXT\r
17 \r
18 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
19 ; Manual context switch function.  This is the SWI hander.\r
20 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
21 vPortYieldProcessor:\r
22         ADD             LR, LR, #4                      ; Add 4 to the LR to make the LR appear exactly\r
23                                                                 ; as if the context was saved during and IRQ\r
24                                                                 ; handler.\r
25                                                                 \r
26         portSAVE_CONTEXT                        ; Save the context of the current task...\r
27         LDR R0, =vTaskSwitchContext     ; before selecting the next task to execute.\r
28         mov     lr, pc\r
29         BX R0\r
30         portRESTORE_CONTEXT                     ; Restore the context of the selected task.\r
31 \r
32 \r
33         END\r
34 \r