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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [newlib/] [libc/] [machine/] [d30v/] [setjmp.S] - Blame information for rev 862

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

Line No. Rev Author Line
1 148 jeremybenn
; setjmp/longjmp for D30V.
2
 
3
        .text
4
        .globl  setjmp
5
        .type   setjmp,@function
6
        .stabs  "setjmp.S",100,0,0,setjmp
7
        .stabs  "int:t(0,1)=r(0,1);-2147483648;2147483647;",128,0,0,0
8
        .stabs  "setjmp:F(0,1)",36,0,1,setjmp
9
 
10
setjmp:
11
; Address of jmpbuf is passed in R2.  Save the appropriate registers.
12
        st2w    r26, @(r2+,r0)
13
        st2w    r28, @(r2+,r0)
14
        st2w    r30, @(r2+,r0)
15
        st2w    r32, @(r2+,r0)
16
        st2w    r34, @(r2+,r0)
17
        st2w    r36, @(r2+,r0)
18
        st2w    r38, @(r2+,r0)
19
        st2w    r40, @(r2+,r0)
20
        st2w    r42, @(r2+,r0)
21
        st2w    r44, @(r2+,r0)
22
        st2w    r46, @(r2+,r0)
23
        st2w    r48, @(r2+,r0)
24
        st2w    r50, @(r2+,r0)
25
        st2w    r52, @(r2+,r0)
26
        st2w    r54, @(r2+,r0)
27
        st2w    r56, @(r2+,r0)
28
        st2w    r58, @(r2+,r0)
29
        st2w    r60, @(r2+,r0)
30
        st2w    r62, @(r2+,r0)
31
 
32
        mvfacc  r4, a1, 16
33
        mvfacc  r5, a1, 0
34
        st2w    r4, @(r2+,r0)
35
 
36
        mvfsys  r4, psw
37
        mvfsys  r5, rpt_c
38
        st2w    r4, @(r2+,r0)
39
 
40
        mvfsys  r4, rpt_s
41
        mvfsys  r5, rpt_e
42
        st2w    r4, @(r2+,r0)
43
 
44
        mvfsys  r4, mod_s
45
        mvfsys  r5, mod_e
46
        st2w    r4, @(r2+,r0)
47
 
48
; Return 0 to caller
49
        add     r2, r0, r0
50
        jmp     link
51
.Lsetjmp:
52
        .size   setjmp,.Lsetjmp-setjmp
53
        .stabs  "",36,0,0,.Lsetjmp-setjmp
54
 
55
        .globl  longjmp
56
        .type   longjmp,@function
57
        .stabs  "longjmp:F(0,1)",36,0,1,longjmp
58
longjmp:
59
; Address of jmpbuf is in R2.  Restore the registers.
60
        ld2w    r26, @(r2+,r0)
61
        ld2w    r28, @(r2+,r0)
62
        ld2w    r30, @(r2+,r0)
63
        ld2w    r32, @(r2+,r0)
64
        ld2w    r34, @(r2+,r0)
65
        ld2w    r36, @(r2+,r0)
66
        ld2w    r38, @(r2+,r0)
67
        ld2w    r40, @(r2+,r0)
68
        ld2w    r42, @(r2+,r0)
69
        ld2w    r44, @(r2+,r0)
70
        ld2w    r46, @(r2+,r0)
71
        ld2w    r48, @(r2+,r0)
72
        ld2w    r50, @(r2+,r0)
73
        ld2w    r52, @(r2+,r0)
74
        ld2w    r54, @(r2+,r0)
75
        ld2w    r56, @(r2+,r0)
76
        ld2w    r58, @(r2+,r0)
77
        ld2w    r60, @(r2+,r0)
78
        ld2w    r62, @(r2+,r0)
79
 
80
        ld2w    r4, @(r2+,r0)
81
        mvtacc  a1, r4, r5
82
 
83
        mvfsys  r6, psw
84
        ld2w    r4, @(r2+,r0)           /* psw, rpt_c */
85
        and     r6, r6, 0xfcff          /* set rp, md bits from setjmp, leave */
86
        and     r4, r4, 0x0300          /* all other psw bits the same */
87
        or      r4, r4, r6
88
        mvtsys  psw, r4
89
        mvtsys  rpt_c, r5
90
 
91
        ld2w    r4, @(r2+,r0)
92
        mvtsys  rpt_s, r4
93
        mvtsys  rpt_e, r5
94
 
95
        ld2w    r4, @(r2+,r0)
96
        mvtsys  mod_s, r4
97
        mvtsys  mod_e, r5
98
 
99
; Value to return to caller is in R3.  If caller attemped to return 0,
100
; return 1 instead.
101
 
102
        cmpeq   f0, r3, 0       ||      add     r2, r3, r0
103
        jmp     link            ||      add/tx  r2, r2, 1
104
.Llongjmp:
105
        .size   longjmp,.Llongjmp-longjmp
106
        .stabs  "",36,0,0,.Llongjmp-longjmp

powered by: WebSVN 2.1.0

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