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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.17.0/] [newlib/] [libc/] [machine/] [frv/] [setjmp.S] - Blame information for rev 148

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

Line No. Rev Author Line
1 148 jeremybenn
# setjmp/longjmp for Frv.  The jmpbuf looks like this:
2
#
3
# Register      jmpbuf offset
4
# R16-R31       0x0-0x03c
5
# R48-R63       0x40-0x7c
6
# FR16-FR31     0x80-0xbc
7
# FR48-FR63     0xc0-0xfc
8
# LR            0x100
9
# SP            0x104
10
# FP            0x108
11
#
12
# R8 contains the pointer to jmpbuf
13
 
14
#include 
15
 
16
        .text
17
        .global EXT(setjmp)
18
        .type   EXT(setjmp),@function
19
EXT(setjmp):
20
        stdi    gr16, @(gr8,0)
21
        stdi    gr18, @(gr8,8)
22
        stdi    gr20, @(gr8,16)
23
        stdi    gr22, @(gr8,24)
24
        stdi    gr24, @(gr8,32)
25
        stdi    gr26, @(gr8,40)
26
        stdi    gr28, @(gr8,48)
27
        stdi    gr30, @(gr8,56)
28
#if __FRV_GPR__ != 32
29
        stdi    gr48, @(gr8,64)
30
        stdi    gr50, @(gr8,72)
31
        stdi    gr52, @(gr8,80)
32
        stdi    gr54, @(gr8,88)
33
        stdi    gr56, @(gr8,96)
34
        stdi    gr58, @(gr8,104)
35
        stdi    gr60, @(gr8,112)
36
        stdi    gr62, @(gr8,120)
37
#endif
38
 
39
#if __FRV_FPR__ != 0
40
        stdfi   fr16, @(gr8,128)
41
        stdfi   fr18, @(gr8,136)
42
        stdfi   fr20, @(gr8,144)
43
        stdfi   fr22, @(gr8,152)
44
        stdfi   fr24, @(gr8,160)
45
        stdfi   fr26, @(gr8,168)
46
        stdfi   fr28, @(gr8,176)
47
        stdfi   fr30, @(gr8,184)
48
#if __FRV_FPR__ != 32
49
        stdfi   fr48, @(gr8,192)
50
        stdfi   fr50, @(gr8,200)
51
        stdfi   fr52, @(gr8,208)
52
        stdfi   fr54, @(gr8,216)
53
        stdfi   fr56, @(gr8,224)
54
        stdfi   fr58, @(gr8,232)
55
        stdfi   fr60, @(gr8,240)
56
        stdfi   fr62, @(gr8,248)
57
#endif
58
#endif
59
 
60
        movsg   lr, gr4
61
        sti     gr4, @(gr8,256)
62
        sti     sp, @(gr8,260)
63
        sti     fp, @(gr8,264)
64
 
65
        mov     gr0,gr8
66
        ret
67
.Lend1:
68
        .size   EXT(setjmp),.Lend1-EXT(setjmp)
69
 
70
        .global EXT(longjmp)
71
        .type   EXT(longjmp),@function
72
EXT(longjmp):
73
        lddi    @(gr8,0), gr16
74
        lddi    @(gr8,8), gr18
75
        lddi    @(gr8,16), gr20
76
        lddi    @(gr8,24), gr22
77
        lddi    @(gr8,32), gr24
78
        lddi    @(gr8,40), gr26
79
        lddi    @(gr8,48), gr28
80
        lddi    @(gr8,56), gr30
81
#if __FRV_GPR__ != 32
82
        lddi    @(gr8,64), gr48
83
        lddi    @(gr8,72), gr50
84
        lddi    @(gr8,80), gr52
85
        lddi    @(gr8,88), gr54
86
        lddi    @(gr8,96), gr56
87
        lddi    @(gr8,104), gr58
88
        lddi    @(gr8,112), gr60
89
        lddi    @(gr8,120), gr62
90
#endif
91
 
92
#if __FRV_FPR__ != 0
93
        lddfi   @(gr8,128), fr16
94
        lddfi   @(gr8,136), fr18
95
        lddfi   @(gr8,144), fr20
96
        lddfi   @(gr8,152), fr22
97
        lddfi   @(gr8,160), fr24
98
        lddfi   @(gr8,168), fr26
99
        lddfi   @(gr8,176), fr28
100
        lddfi   @(gr8,184), fr30
101
#if __FRV_FPR__ != 32
102
        lddfi   @(gr8,192), fr48
103
        lddfi   @(gr8,200), fr50
104
        lddfi   @(gr8,208), fr52
105
        lddfi   @(gr8,216), fr54
106
        lddfi   @(gr8,224), fr56
107
        lddfi   @(gr8,232), fr58
108
        lddfi   @(gr8,240), fr60
109
        lddfi   @(gr8,248), fr62
110
#endif
111
#endif
112
 
113
        ldi     @(gr8,256), gr4
114
        movgs   gr4,lr
115
 
116
        ldi     @(gr8,260), sp
117
        ldi     @(gr8,264), fp
118
 
119
# Value to return is in r9.  If zero, return 1
120
        cmp     gr9, gr0, icc0
121
        setlos  #1, gr8
122
        ckne    icc0, cc4
123
        cmov    gr9, gr8, cc4, 1
124
        ret
125
.Lend2:
126
        .size   EXT(longjmp),.Lend2-EXT(longjmp2)

powered by: WebSVN 2.1.0

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