1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
/*
* Copyright (c) 1990,1994 The University of Utah and
* the Computer Systems Laboratory (CSL). All rights reserved.
*
* Permission to use, copy, modify and distribute this software is hereby
* granted provided that (1) source code retains these copyright, permission,
* and disclaimer notices, and (2) redistributions including binaries
* reproduce the notices in supporting documentation, and (3) all advertising
* materials mentioning features or use of this software display the following
* acknowledgement: ``This product includes software developed by the
* Computer Systems Laboratory at the University of Utah.''
*
* THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
* IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
* ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* CSL requests users of this software to return to csl-dist@cs.utah.edu any
* improvements that they make and grant CSL redistribution rights.
*
* Utah $Hdr: _setjmp.s 1.9 94/12/16$
*/
.space $TEXT$
.subspa $CODE$
/*
* The PA jmp_buf is 48 words arranged as follows:
*
* 0- 9: sigcontext
* 10-26: callee save GRs (r3-r18) and DP (r27)
* 27: callee save SRs (sr3)
* 28-47: callee save FRs (fr12-fr21)
*/
/*
* int
* setjmp(env)
* jmp_buf env;
*
* This routine does not restore signal state.
*/
.export setjmp,entry
.export _setjmp,entry
.proc
.callinfo
setjmp
_setjmp
.entry
/*
* save sp and rp in sigcontext, skip the rest
*/
stw %r30,8(%r26)
stw %r2,24(%r26)
ldo 40(%r26),%r26
/*
* save dp and the callee saves registers
*/
stwm %r3,4(%r26)
stwm %r4,4(%r26)
stwm %r5,4(%r26)
stwm %r6,4(%r26)
stwm %r7,4(%r26)
stwm %r8,4(%r26)
stwm %r9,4(%r26)
stwm %r10,4(%r26)
stwm %r11,4(%r26)
stwm %r12,4(%r26)
stwm %r13,4(%r26)
stwm %r14,4(%r26)
stwm %r15,4(%r26)
stwm %r16,4(%r26)
stwm %r17,4(%r26)
stwm %r18,4(%r26)
stwm %r27,4(%r26)
mfsp %sr3,%r9
stwm %r9,4(%r26)
bv 0(%r2)
copy %r0,%r28
.exit
.procend
/*
* void
* longjmp(env, val)
* jmp_buf env;
* int val;
*
* This routine does not retore signal state.
* This routine does not override a zero val.
*/
.export longjmp,entry
.export _longjmp,entry
.proc
.callinfo
longjmp
_longjmp
.entry
/*
* restore sp and rp
*/
ldw 8(%r26),%r30
ldw 24(%r26),%r2
ldo 40(%r26),%r26
/*
* restore callee saves registers
*/
ldwm 4(%r26),%r3
ldwm 4(%r26),%r4
ldwm 4(%r26),%r5
ldwm 4(%r26),%r6
ldwm 4(%r26),%r7
ldwm 4(%r26),%r8
ldwm 4(%r26),%r9
ldwm 4(%r26),%r10
ldwm 4(%r26),%r11
ldwm 4(%r26),%r12
ldwm 4(%r26),%r13
ldwm 4(%r26),%r14
ldwm 4(%r26),%r15
ldwm 4(%r26),%r16
ldwm 4(%r26),%r17
ldwm 4(%r26),%r18
ldwm 4(%r26),%r27
ldwm 4(%r26),%r9
mtsp %r9,%sr3
bv 0(%r2)
copy %r25,%r28
.exit
.procend
|