]> git.sur5r.net Git - freertos/blob - Source/portable/IAR/STR71x/portasm.s79
First version under SVN is V4.0.1
[freertos] / Source / portable / IAR / STR71x / portasm.s79
1                 RSEG ICODE:CODE\r
2                 CODE32\r
3 \r
4         EXTERN vPortPreemptiveTick\r
5         EXTERN vTaskSwitchContext\r
6 \r
7         PUBLIC vPortYieldProcessor\r
8         PUBLIC vPortStartFirstTask\r
9         PUBLIC vPortPreemptiveTickISR\r
10 \r
11 #include "ISR_Support.h"\r
12 \r
13 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
14 ; Starting the first task is just a matter of restoring the context that\r
15 ; was created by pxPortInitialiseStack().\r
16 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
17 vPortStartFirstTask:\r
18         portRESTORE_CONTEXT\r
19 \r
20 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
21 ; Manual context switch function.  This is the SWI hander.\r
22 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
23 vPortYieldProcessor:\r
24         ADD             LR, LR, #4                      ; Add 4 to the LR to make the LR appear exactly\r
25                                                                 ; as if the context was saved during and IRQ\r
26                                                                 ; handler.\r
27                                                                 \r
28         portSAVE_CONTEXT                        ; Save the context of the current task...\r
29         LDR R0, =vTaskSwitchContext     ; before selecting the next task to execute.\r
30         mov     lr, pc\r
31         BX R0\r
32         portRESTORE_CONTEXT                     ; Restore the context of the selected task.\r
33 \r
34 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
35 ; Preemptive context switch function.  This will only ever get used if\r
36 ; portUSE_PREEMPTION is set to 1 in portmacro.h.\r
37 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
38 vPortPreemptiveTickISR:\r
39         portSAVE_CONTEXT                        ; Save the context of the current task.\r
40 \r
41         LDR R0, =vPortPreemptiveTick ; Increment the tick count - this may wake a task.\r
42         MOV lr, pc\r
43         BX R0\r
44 \r
45         portRESTORE_CONTEXT                     ; Restore the context of the selected task.\r
46 \r
47 \r
48         END\r
49 \r