Print this page
de-linting of .s files
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/i86xpv/ml/panic_asm.s
+++ new/usr/src/uts/i86xpv/ml/panic_asm.s
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26
27 -#pragma ident "%Z%%M% %I% %E% SMI"
28 -
29 27 #include <sys/asm_linkage.h>
30 28 #include <sys/hypervisor.h>
31 29 #include <sys/privregs.h>
32 30 #include <sys/segments.h>
33 31 #include <sys/traptrace.h>
34 32 #include <sys/trap.h>
35 33 #include <sys/psw.h>
36 34 #include <sys/x86_archext.h>
37 35 #include <sys/asm_misc.h>
38 36 #include <sys/panic.h>
39 37
40 -#if !defined(__lint)
41 38 #include "assym.h"
42 -#endif
43 39
44 -#if defined(__lint)
45 -
46 -void
47 -xpv_panic_callback(void)
48 -{}
49 -
50 -/* ARGSUSED */
51 -void
52 -xpv_panic_setcr3(ulong_t cr3)
53 -{}
54 -
55 -void
56 -xpv_panic_reload_cr3(void)
57 -{}
58 -
59 -void
60 -xpv_resetgs(void)
61 -{}
62 -
63 -#else /* __lint */
64 -
65 40 #if defined(__amd64)
66 41 ENTRY_NP(xpv_panic_getcr3)
67 42 movq %cr3, %rax
68 43 ret
69 44 SET_SIZE(xpv_panic_getcr3)
70 45
71 46 ENTRY_NP(xpv_panic_setcr3)
72 47 movq %rdi, %cr3
73 48 ret
74 49 SET_SIZE(xpv_panic_setcr3)
75 50
76 51 ENTRY(xpv_panic_reload_cr3)
77 52 movq %cr3, %rdi
78 53 movq %rdi, %cr3
79 54 ret
80 55 SET_SIZE(xpv_panic_reload_cr3)
81 56
82 57 ENTRY_NP(xpv_panic_prep)
83 58 pushq %rbp
84 59 movq %rsp, %rbp
85 60
86 61 subq $REGSIZE, %rsp
87 62 movq %rax, REGOFF_RAX(%rsp)
88 63 movq %rbx, REGOFF_RBX(%rsp)
89 64 movq %rsp, %rax
90 65 addq $REGSIZE, %rax
91 66 movq (%rax), %rbx
92 67 movq %rbx, REGOFF_RBP(%rsp)
93 68 movq 8(%rax), %rbx
94 69 movq %rbx, REGOFF_TRAPNO(%rsp)
95 70 movq 16(%rax), %rbx
96 71 movq %rbx, REGOFF_ERR(%rsp)
97 72 movq 24(%rax), %rbx
98 73 movq %rbx, REGOFF_RIP(%rsp)
99 74 movq 32(%rax), %rbx
100 75 movq %rbx, REGOFF_CS(%rsp)
101 76 movq 40(%rax), %rbx
102 77 movq %rbx, REGOFF_RFL(%rsp)
103 78 addq $56, %rax
104 79 movq %rax, REGOFF_RSP(%rsp)
105 80 xorl %eax, %eax
106 81 movw %gs, %ax
107 82 mov %rax, REGOFF_GS(%rsp)
108 83 movw %fs, %ax
109 84 mov %rax, REGOFF_FS(%rsp)
110 85 movw %es, %ax
111 86 mov %rax, REGOFF_ES(%rsp)
112 87 movw %ds, %ax
113 88 mov %rax, REGOFF_DS(%rsp)
114 89 movw %ss, %ax
115 90 mov %rax, REGOFF_SS(%rsp)
116 91 movq %rcx, REGOFF_RCX(%rsp)
117 92 movq %rdx, REGOFF_RDX(%rsp)
118 93 movq %rdi, REGOFF_RDI(%rsp)
119 94 movq %rsi, REGOFF_RSI(%rsp)
120 95 movq %r8, REGOFF_R8(%rsp)
121 96 movq %r9, REGOFF_R9(%rsp)
122 97 movq %r10, REGOFF_R10(%rsp)
123 98 movq %r11, REGOFF_R11(%rsp)
124 99 movq %r12, REGOFF_R12(%rsp)
125 100 movq %r13, REGOFF_R13(%rsp)
126 101 movq %r14, REGOFF_R14(%rsp)
127 102 movq %r15, REGOFF_R15(%rsp)
128 103
129 104 movq %rsp, %rdi
130 105 call xpv_die
131 106 SET_SIZE(xpv_panic_prep)
132 107
133 108 /*
134 109 * Switch to the Solaris panic stack and jump into the Xen panic
135 110 * handling code.
136 111 */
137 112 ENTRY_NP(xpv_panic_hdlr)
138 113 leaq panic_stack(%rip), %rsp
139 114 addq $PANICSTKSIZE, %rsp
140 115 call xpv_do_panic
141 116 SET_SIZE(xpv_panic_hdlr)
142 117
143 118 ENTRY_NP(xpv_surprise_intr)
144 119 pushq %rbp
145 120 movq %rsp, %rbp
146 121 subq $REGOFF_TRAPNO, %rsp
147 122 __SAVE_REGS
148 123 movq %rsp, %rdi
149 124 addq $REGOFF_TRAPNO, %rdi
150 125 call xpv_interrupt
151 126 __RESTORE_REGS
152 127 addq $REGOFF_TRAPNO, %rsp
153 128 popq %rbp
154 129 iretq
155 130 SET_SIZE(xpv_surprise_intr)
156 131
157 132 ENTRY_NP(xpv_timer_trap)
158 133 pushq %rbp
159 134 movq %rsp, %rbp
160 135 subq $REGOFF_TRAPNO, %rsp
161 136 __SAVE_REGS
162 137 movq %rsp, %rdi
163 138 addq $REGOFF_TRAPNO, %rdi
164 139 call xpv_timer_tick
165 140 __RESTORE_REGS
166 141 addq $REGOFF_TRAPNO, %rsp
167 142 popq %rbp
168 143 iretq
169 144 SET_SIZE(xpv_timer_trap)
170 145
171 146 #elif defined(__i386)
172 147
173 148 ENTRY_NP(xpv_panic_setcr3)
174 149 movl 4(%esp), %eax
175 150 movl %eax, %cr3
176 151 ret
177 152 SET_SIZE(xpv_panic_setcr3)
178 153
179 154 ENTRY(xpv_panic_reload_cr3)
180 155 movl %cr3, %eax
181 156 movl %eax, %cr3
182 157 ret
183 158 SET_SIZE(xpv_panic_reload_cr3)
184 159
185 160 /*
186 161 * Stack on entry:
187 162 * +------------+
188 163 * | EFLAGS |
189 164 * | CS |
190 165 * | EIP |
191 166 * | Error |
192 167 * | Trap | <---- %esp
193 168 * +------------+
194 169 */
195 170 ENTRY_NP(xpv_panic_prep)
196 171 pushl %ebp
197 172 movl %esp, %ebp
198 173
199 174 subl $REGSIZE, %esp
200 175 movl %eax, REGOFF_EAX(%esp)
201 176 movl %ebx, REGOFF_EBX(%esp)
202 177 movl %esp, %eax
203 178 addl $REGSIZE, %eax
204 179 movl (%eax), %ebx
205 180 movl %ebx, REGOFF_EBP(%esp)
206 181 movl 4(%eax), %ebx
207 182 movl %ebx, REGOFF_TRAPNO(%esp)
208 183 movl 8(%eax), %ebx
209 184 movl %ebx, REGOFF_ERR(%esp)
210 185 movl 12(%eax), %ebx
211 186 movl %ebx, REGOFF_EIP(%esp)
212 187 movl 16(%eax), %ebx
213 188 movl %ebx, REGOFF_CS(%esp)
214 189 movl 20(%eax), %ebx
215 190 movl %ebx, REGOFF_EFL(%esp)
216 191 addl $28, %eax
217 192 movl %eax, REGOFF_ESP(%esp)
218 193 xorl %eax, %eax
219 194 movw %gs, %ax
220 195 mov %eax, REGOFF_GS(%esp)
221 196 movw %fs, %ax
222 197 mov %eax, REGOFF_FS(%esp)
223 198 movw %es, %ax
224 199 mov %eax, REGOFF_ES(%esp)
225 200 movw %ds, %ax
226 201 mov %eax, REGOFF_DS(%esp)
227 202 movw %ss, %ax
228 203 mov %eax, REGOFF_SS(%esp)
229 204 movl %ecx, REGOFF_ECX(%esp)
230 205 movl %edx, REGOFF_EDX(%esp)
231 206 movl %edi, REGOFF_EDI(%esp)
232 207 movl %esi, REGOFF_ESI(%esp)
233 208 pushl %esp
234 209 call xpv_die
235 210 SET_SIZE(xpv_panic_prep)
236 211
237 212 /*
238 213 * Switch to the Solaris panic stack and jump into the Xen panic
239 214 * handling code.
240 215 */
241 216 ENTRY_NP(xpv_panic_hdlr)
242 217 movl 4(%esp), %eax
243 218 lea panic_stack, %esp
244 219 add $PANICSTKSIZE, %esp
245 220 pushl %eax
246 221 call xpv_do_panic
247 222 SET_SIZE(xpv_panic_hdlr)
248 223
249 224 ENTRY_NP(xpv_surprise_intr)
250 225 push %ebp
251 226 movl %esp, %ebp
252 227 pusha
253 228 call xpv_interrupt
254 229 popa
255 230 pop %ebp
256 231 iret
257 232 SET_SIZE(xpv_surprise_intr)
258 233
259 234 ENTRY_NP(xpv_timer_trap)
260 235 push %ebp
261 236 movl %esp, %ebp
262 237 pusha
263 238 call xpv_timer_tick
264 239 popa
265 240 pop %ebp
266 241 iret
267 242 SET_SIZE(xpv_timer_trap)
268 243
269 244 #endif /* __i386 */
270 245
271 246 ENTRY_NP(xpv_panic_sti)
272 247 sti
273 248 ret
274 249 SET_SIZE(xpv_panic_sti)
275 250
276 251 ENTRY_NP(xpv_panic_halt)
277 252 sti
278 253 hlt
279 254 ret
280 255 SET_SIZE(xpv_panic_halt)
281 256
282 257 ENTRY_NP(xpv_panic_resetgs)
283 258 movl $KGS_SEL, %eax
284 259 movw %ax, %gs
285 260 ret
286 261 SET_SIZE(xpv_panic_resetgs)
287 262
288 263 ENTRY_NP(xpv_invaltrap)
289 264 push $0xbad0
290 265 push $0x0bad
291 266 jmp xpv_panic_prep
292 267 SET_SIZE(xpv_invaltrap)
293 268
294 269 ENTRY_NP(xpv_div0trap)
295 270 push $0
296 271 push $T_ZERODIV
297 272 jmp xpv_panic_prep
298 273 SET_SIZE(xpv_div0trap)
299 274
300 275 ENTRY_NP(xpv_dbgtrap)
301 276 push $0
302 277 push $T_SGLSTP
303 278 jmp xpv_panic_prep
304 279 SET_SIZE(xpv_dbgtrap)
305 280
306 281 ENTRY_NP(xpv_nmiint)
307 282 push $0
308 283 push $T_NMIFLT
309 284 jmp xpv_panic_prep
310 285 SET_SIZE(xpv_nmiint)
311 286
312 287 ENTRY_NP(xpv_brktrap)
313 288 /* XXX: check for error */
314 289 push $T_BPTFLT
315 290 jmp xpv_panic_prep
316 291 SET_SIZE(xpv_brktrap)
317 292
318 293 ENTRY_NP(xpv_ovflotrap)
319 294 push $0
320 295 push $T_OVFLW
321 296 jmp xpv_panic_prep
322 297 SET_SIZE(xpv_ovflotrap)
323 298
324 299 ENTRY_NP(xpv_boundstrap)
325 300 push $0
326 301 push $T_BOUNDFLT
327 302 jmp xpv_panic_prep
328 303 SET_SIZE(xpv_boundstrap)
329 304
330 305 ENTRY_NP(xpv_invoptrap)
331 306 push $T_ILLINST
332 307 jmp xpv_panic_prep
333 308 SET_SIZE(xpv_invoptrap)
334 309
335 310 ENTRY_NP(xpv_ndptrap)
336 311 push $0
337 312 push $T_NOEXTFLT
338 313 jmp xpv_panic_prep
339 314 SET_SIZE(xpv_ndptrap)
340 315
341 316 ENTRY_NP(xpv_syserrtrap)
342 317 /* XXX: check for error */
343 318 push $T_DBLFLT
344 319 jmp xpv_panic_prep
345 320 SET_SIZE(xpv_syserrtrap)
346 321
347 322 ENTRY_NP(xpv_invtsstrap)
348 323 push $T_TSSFLT
349 324 jmp xpv_panic_prep
350 325 SET_SIZE(xpv_invtsstrap)
351 326
352 327 ENTRY_NP(xpv_segnptrap)
353 328 push $T_SEGFLT
354 329 jmp xpv_panic_prep
355 330 SET_SIZE(xpv_segnptrap)
356 331
357 332 ENTRY_NP(xpv_stktrap)
358 333 push $T_STKFLT
359 334 jmp xpv_panic_prep
360 335 SET_SIZE(xpv_stktrap)
361 336
362 337 ENTRY_NP(xpv_gptrap)
363 338 push $T_GPFLT
364 339 jmp xpv_panic_prep
365 340 SET_SIZE(xpv_gptrap)
366 341
367 342 ENTRY_NP(xpv_pftrap)
368 343 push $T_PGFLT
369 344 jmp xpv_panic_prep
370 345 SET_SIZE(xpv_pftrap)
371 346
372 347 ENTRY_NP(xpv_ndperr)
373 348 push $0
374 349 push $T_EXTERRFLT
375 350 jmp xpv_panic_prep
376 351 SET_SIZE(xpv_ndperr)
377 352
378 353 ENTRY_NP(xpv_achktrap)
379 354 push $T_ALIGNMENT
380 355 jmp xpv_panic_prep
381 356 SET_SIZE(xpv_achktrap)
382 357
383 358 ENTRY_NP(xpv_mcetrap)
384 359 push $0
↓ open down ↓ |
310 lines elided |
↑ open up ↑ |
385 360 push $T_MCE
386 361 jmp xpv_panic_prep
387 362 SET_SIZE(xpv_mcetrap)
388 363
389 364 ENTRY_NP(xpv_xmtrap)
390 365 push $0
391 366 push $T_SIMDFPE
392 367 jmp xpv_panic_prep
393 368 SET_SIZE(xpv_xmtrap)
394 369
395 -#endif /* __lint */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX