1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 #include <asm/asmmacro.h>
17 #include <asm/processor.h>
18 #include <asm/export.h>
19
20 .data
21 pal_entry_point:
22 data8 ia64_pal_default_handler
23 .text
24
25
26
27
28
29
30
31
32
33 GLOBAL_ENTRY(ia64_pal_handler_init)
34 alloc r3=ar.pfs,1,0,0,0
35 movl r2=pal_entry_point
36 ;;
37 st8 [r2]=in0
38 br.ret.sptk.many rp
39 END(ia64_pal_handler_init)
40
41
42
43
44
45
46 GLOBAL_ENTRY(ia64_pal_default_handler)
47 mov r8=-1
48 br.cond.sptk.many rp
49 END(ia64_pal_default_handler)
50
51
52
53
54
55
56
57 GLOBAL_ENTRY(ia64_pal_call_static)
58 .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(4)
59 alloc loc1 = ar.pfs,4,5,0,0
60 movl loc2 = pal_entry_point
61 1: {
62 mov r28 = in0
63 mov r29 = in1
64 mov r8 = ip
65 }
66 ;;
67 ld8 loc2 = [loc2]
68 adds r8 = 1f-1b,r8
69 mov loc4=ar.rsc
70 ;;
71 mov ar.rsc=0
72 mov loc3 = psr
73 mov loc0 = rp
74 .body
75 mov r30 = in2
76
77 mov r31 = in3
78 mov b7 = loc2
79
80 rsm psr.i
81 ;;
82 mov rp = r8
83 br.cond.sptk.many b7
84 1: mov psr.l = loc3
85 mov ar.rsc = loc4
86 mov ar.pfs = loc1
87 mov rp = loc0
88 ;;
89 srlz.d
90 br.ret.sptk.many b0
91 END(ia64_pal_call_static)
92 EXPORT_SYMBOL(ia64_pal_call_static)
93
94
95
96
97
98
99
100
101 GLOBAL_ENTRY(ia64_pal_call_stacked)
102 .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(4)
103 alloc loc1 = ar.pfs,4,4,4,0
104 movl loc2 = pal_entry_point
105
106 mov r28 = in0
107 mov out0 = in0
108 mov loc0 = rp
109 .body
110 ;;
111 ld8 loc2 = [loc2]
112 mov out1 = in1
113 mov out2 = in2
114 mov out3 = in3
115 mov loc3 = psr
116 ;;
117 rsm psr.i
118 mov b7 = loc2
119 ;;
120 br.call.sptk.many rp=b7
121 .ret0: mov psr.l = loc3
122 mov ar.pfs = loc1
123 mov rp = loc0
124 ;;
125 srlz.d
126 br.ret.sptk.many b0
127 END(ia64_pal_call_stacked)
128 EXPORT_SYMBOL(ia64_pal_call_stacked)
129
130
131
132
133
134
135
136
137
138
139
140 #define PAL_PSR_BITS_TO_CLEAR \
141 (IA64_PSR_I | IA64_PSR_IT | IA64_PSR_DT | IA64_PSR_DB | IA64_PSR_RT |\
142 IA64_PSR_DD | IA64_PSR_SS | IA64_PSR_RI | IA64_PSR_ED | \
143 IA64_PSR_DFL | IA64_PSR_DFH)
144
145 #define PAL_PSR_BITS_TO_SET \
146 (IA64_PSR_BN)
147
148
149 GLOBAL_ENTRY(ia64_pal_call_phys_static)
150 .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(4)
151 alloc loc1 = ar.pfs,4,7,0,0
152 movl loc2 = pal_entry_point
153 1: {
154 mov r28 = in0
155 mov r8 = ip
156 mov loc0 = rp
157 }
158 .body
159 ;;
160 ld8 loc2 = [loc2]
161 mov r29 = in1
162 mov r30 = in2
163 mov r31 = in3
164 ;;
165 mov loc3 = psr
166 adds r8 = 1f-1b,r8
167 ;;
168 mov loc4=ar.rsc
169 dep.z loc2=loc2,0,61
170 tpa r8=r8
171 ;;
172 mov b7 = loc2
173 mov ar.rsc=0
174 movl r16=PAL_PSR_BITS_TO_CLEAR
175 movl r17=PAL_PSR_BITS_TO_SET
176 ;;
177 or loc3=loc3,r17
178 ;;
179 andcm r16=loc3,r16
180 br.call.sptk.many rp=ia64_switch_mode_phys
181 mov rp = r8
182 mov loc5 = r19
183 mov loc6 = r20
184 br.cond.sptk.many b7
185 1:
186 mov ar.rsc=0
187 mov r16=loc3
188 mov r19=loc5
189 mov r20=loc6
190 br.call.sptk.many rp=ia64_switch_mode_virt
191 mov psr.l = loc3
192
193 mov ar.pfs = loc1
194 mov rp = loc0
195 ;;
196 mov ar.rsc=loc4
197 srlz.d
198 br.ret.sptk.many b0
199 END(ia64_pal_call_phys_static)
200 EXPORT_SYMBOL(ia64_pal_call_phys_static)
201
202
203
204
205
206
207
208
209 GLOBAL_ENTRY(ia64_pal_call_phys_stacked)
210 .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(5)
211 alloc loc1 = ar.pfs,5,7,4,0
212 movl loc2 = pal_entry_point
213 1: {
214 mov r28 = in0
215 mov loc0 = rp
216 }
217 .body
218 ;;
219 ld8 loc2 = [loc2]
220 mov loc3 = psr
221 ;;
222 mov loc4=ar.rsc
223 dep.z loc2=loc2,0,61
224 ;;
225 mov ar.rsc=0
226 movl r16=PAL_PSR_BITS_TO_CLEAR
227 movl r17=PAL_PSR_BITS_TO_SET
228 ;;
229 or loc3=loc3,r17
230 mov b7 = loc2
231 ;;
232 andcm r16=loc3,r16
233 br.call.sptk.many rp=ia64_switch_mode_phys
234
235 mov out0 = in0
236 mov out1 = in1
237 mov out2 = in2
238 mov out3 = in3
239 mov loc5 = r19
240 mov loc6 = r20
241
242 br.call.sptk.many rp=b7
243
244 mov ar.rsc=0
245 mov r16=loc3
246 mov r19=loc5
247 mov r20=loc6
248 br.call.sptk.many rp=ia64_switch_mode_virt
249
250 mov psr.l = loc3
251 mov ar.pfs = loc1
252 mov rp = loc0
253 ;;
254 mov ar.rsc=loc4
255 srlz.d
256 br.ret.sptk.many b0
257 END(ia64_pal_call_phys_stacked)
258 EXPORT_SYMBOL(ia64_pal_call_phys_stacked)
259
260
261
262
263
264
265
266
267
268
269
270 GLOBAL_ENTRY(ia64_save_scratch_fpregs)
271 alloc r3=ar.pfs,1,0,0,0
272 add r2=16,in0
273 ;;
274 stf.spill [in0] = f10,32
275 stf.spill [r2] = f11,32
276 ;;
277 stf.spill [in0] = f12,32
278 stf.spill [r2] = f13,32
279 ;;
280 stf.spill [in0] = f14,32
281 stf.spill [r2] = f15,32
282 br.ret.sptk.many rp
283 END(ia64_save_scratch_fpregs)
284 EXPORT_SYMBOL(ia64_save_scratch_fpregs)
285
286
287
288
289
290
291
292 GLOBAL_ENTRY(ia64_load_scratch_fpregs)
293 alloc r3=ar.pfs,1,0,0,0
294 add r2=16,in0
295 ;;
296 ldf.fill f10 = [in0],32
297 ldf.fill f11 = [r2],32
298 ;;
299 ldf.fill f12 = [in0],32
300 ldf.fill f13 = [r2],32
301 ;;
302 ldf.fill f14 = [in0],32
303 ldf.fill f15 = [r2],32
304 br.ret.sptk.many rp
305 END(ia64_load_scratch_fpregs)
306 EXPORT_SYMBOL(ia64_load_scratch_fpregs)