OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Source/] [portable/] [IAR/] [AtmelSAM7S64/] [portasm.s79] - Blame information for rev 820

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 vTaskSwitchContext
5
        EXTERN vTaskIncrementTick
6
 
7
        PUBLIC vPortYieldProcessor
8
        PUBLIC vPortPreemptiveTick
9
        PUBLIC vPortStartFirstTask
10
 
11
#include "AT91SAM7S64_inc.h"
12
#include "ISR_Support.h"
13
 
14
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
15
; Starting the first task is just a matter of restoring the context that
16
; was created by pxPortInitialiseStack().
17
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
18
vPortStartFirstTask:
19
        portRESTORE_CONTEXT
20
 
21
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
22
; Manual context switch function.  This is the SWI hander.
23
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
24
vPortYieldProcessor:
25
        ADD             LR, LR, #4                      ; Add 4 to the LR to make the LR appear exactly
26
                                                                ; as if the context was saved during and IRQ
27
                                                                ; handler.
28
 
29
        portSAVE_CONTEXT                        ; Save the context of the current task...
30
        LDR R0, =vTaskSwitchContext     ; before selecting the next task to execute.
31
        mov     lr, pc
32
        BX R0
33
        portRESTORE_CONTEXT                     ; Restore the context of the selected task.
34
 
35
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
36
; Preemptive context switch function.  This will only ever get installed if
37
; portUSE_PREEMPTION is set to 1 in portmacro.h.
38
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
39
vPortPreemptiveTick:
40
        portSAVE_CONTEXT                        ; Save the context of the current task.
41
 
42
        LDR R0, =vTaskIncrementTick ; Increment the tick count - this may wake a task.
43
        mov lr, pc
44
        BX R0
45
        LDR R0, =vTaskSwitchContext ; Select the next task to execute.
46
        mov lr, pc
47
        BX R0
48
 
49
        LDR     R14, =AT91C_BASE_PITC   ; Clear the PIT interrupt
50
        LDR     R0, [R14, #PITC_PIVR ]
51
 
52
        LDR R14, =AT91C_BASE_AIC        ; Mark the End of Interrupt on the AIC
53
    STR R14, [R14, #AIC_EOICR]
54
 
55
        portRESTORE_CONTEXT                     ; Restore the context of the selected task.
56
 
57
 
58
        END
59
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.