URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
572 |
jeremybenn |
RSEG ICODE:CODE
|
2 |
|
|
CODE32
|
3 |
|
|
|
4 |
|
|
EXTERN vPortPreemptiveTick
|
5 |
|
|
EXTERN vTaskSwitchContext
|
6 |
|
|
|
7 |
|
|
PUBLIC vPortYieldProcessor
|
8 |
|
|
PUBLIC vPortStartFirstTask
|
9 |
|
|
PUBLIC vPortPreemptiveTickISR
|
10 |
|
|
|
11 |
|
|
#include "ISR_Support.h"
|
12 |
|
|
|
13 |
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
14 |
|
|
; Starting the first task is just a matter of restoring the context that
|
15 |
|
|
; was created by pxPortInitialiseStack().
|
16 |
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
17 |
|
|
vPortStartFirstTask:
|
18 |
|
|
portRESTORE_CONTEXT
|
19 |
|
|
|
20 |
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
21 |
|
|
; Manual context switch function. This is the SWI hander.
|
22 |
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
23 |
|
|
vPortYieldProcessor:
|
24 |
|
|
ADD LR, LR, #4 ; Add 4 to the LR to make the LR appear exactly
|
25 |
|
|
; as if the context was saved during and IRQ
|
26 |
|
|
; handler.
|
27 |
|
|
|
28 |
|
|
portSAVE_CONTEXT ; Save the context of the current task...
|
29 |
|
|
LDR R0, =vTaskSwitchContext ; before selecting the next task to execute.
|
30 |
|
|
mov lr, pc
|
31 |
|
|
BX R0
|
32 |
|
|
portRESTORE_CONTEXT ; Restore the context of the selected task.
|
33 |
|
|
|
34 |
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
35 |
|
|
; Preemptive context switch function. This will only ever get used if
|
36 |
|
|
; portUSE_PREEMPTION is set to 1 in portmacro.h.
|
37 |
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
38 |
|
|
vPortPreemptiveTickISR:
|
39 |
|
|
portSAVE_CONTEXT ; Save the context of the current task.
|
40 |
|
|
|
41 |
|
|
LDR R0, =vPortPreemptiveTick ; Increment the tick count - this may wake a task.
|
42 |
|
|
MOV lr, pc
|
43 |
|
|
BX R0
|
44 |
|
|
|
45 |
|
|
portRESTORE_CONTEXT ; Restore the context of the selected task.
|
46 |
|
|
|
47 |
|
|
|
48 |
|
|
END
|
49 |
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.