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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Source/] [portable/] [Renesas/] [SH2A_FPU/] [ISR_Support.inc] - Blame information for rev 825

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 572 jeremybenn
        .macro portSAVE_CONTEXT
2
 
3
        ; Save r0 to r14 and pr.
4
        movml.l r15, @-r15
5
 
6
        ; Save mac1, mach and gbr
7
        sts.l   macl, @-r15
8
        sts.l   mach, @-r15
9
        stc.l   gbr, @-r15
10
 
11
        ; Get the address of pxCurrentTCB
12
        mov.l   #_pxCurrentTCB, r0
13
 
14
        ; Get the address of pxTopOfStack from the TCB.
15
        mov.l   @r0, r0
16
 
17
        ; Save the stack pointer in pxTopOfStack.
18
        mov.l   r15, @r0
19
 
20
        .endm
21
 
22
;-----------------------------------------------------------
23
 
24
        .macro portRESTORE_CONTEXT
25
 
26
        ; Get the address of the pxCurrentTCB variable.
27
        mov.l   #_pxCurrentTCB, r0
28
 
29
        ; Get the address of the task stack from pxCurrentTCB.
30
        mov.l   @r0, r0
31
 
32
        ; Get the task stack itself into the stack pointer.
33
        mov.l   @r0, r15
34
 
35
        ; Restore system registers.
36
        ldc.l   @r15+, gbr
37
        lds.l   @r15+, mach
38
        lds.l   @r15+, macl
39
 
40
        ; Restore r0 to r14 and PR
41
        movml.l @r15+, r15
42
 
43
        ; Pop the SR and PC to jump to the start of the task.
44
        rte
45
        nop
46
 
47
        .endm
48
;-----------------------------------------------------------

powered by: WebSVN 2.1.0

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