4 EXTERN vPortPreemptiveTick
\r
5 EXTERN vTaskSwitchContext
\r
7 PUBLIC vPortYieldProcessor
\r
8 PUBLIC vPortStartFirstTask
\r
9 PUBLIC vPortPreemptiveTickISR
\r
11 #include "ISR_Support.h"
\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
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
28 portSAVE_CONTEXT ; Save the context of the current task...
\r
29 LDR R0, =vTaskSwitchContext ; before selecting the next task to execute.
\r
32 portRESTORE_CONTEXT ; Restore the context of the selected task.
\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
41 LDR R0, =vPortPreemptiveTick ; Increment the tick count - this may wake a task.
\r
45 portRESTORE_CONTEXT ; Restore the context of the selected task.
\r