Print this page
de-linting of .s files
m
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/i86pc/ml/interrupt.s
+++ new/usr/src/uts/i86pc/ml/interrupt.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
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
23 23 * Copyright 2019 Joyent, Inc.
24 24 */
25 25
26 26 /* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
27 27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T */
28 28 /* All Rights Reserved */
↓ open down ↓ |
28 lines elided |
↑ open up ↑ |
29 29
30 30 /* Copyright (c) 1987, 1988 Microsoft Corporation */
31 31 /* All Rights Reserved */
32 32
33 33 #include <sys/asm_linkage.h>
34 34 #include <sys/asm_misc.h>
35 35 #include <sys/regset.h>
36 36 #include <sys/psw.h>
37 37 #include <sys/x86_archext.h>
38 38
39 -#if defined(__lint)
40 -
41 -#include <sys/types.h>
42 -#include <sys/thread.h>
43 -#include <sys/systm.h>
44 -
45 -#else /* __lint */
46 -
47 39 #include <sys/segments.h>
48 40 #include <sys/pcb.h>
49 41 #include <sys/trap.h>
50 42 #include <sys/ftrace.h>
51 43 #include <sys/traptrace.h>
52 44 #include <sys/clock.h>
53 45 #include <sys/panic.h>
54 46 #include "assym.h"
55 47
56 -#endif /* lint */
57 -
58 -#if defined(__lint)
59 -
60 -void
61 -_interrupt(void)
62 -{}
63 -
64 -#else /* __lint */
65 -
66 -#if defined(__amd64)
67 -
68 48 /*
69 49 * Common register usage:
70 50 *
71 51 * %r12 trap trace pointer
72 52 */
73 53 ENTRY_NP2(cmnint, _interrupt)
74 54
75 55 INTR_PUSH
76 56 INTGATE_INIT_KERNEL_FLAGS /* (set kernel rflags values) */
77 57
78 58 /*
79 59 * At the end of TRACE_PTR %r12 points to the current TRAPTRACE entry
80 60 */
81 61 TRACE_PTR(%r12, %rax, %eax, %rdx, $TT_INTERRUPT)
82 62 /* Uses labels 8 and 9 */
83 63 TRACE_REGS(%r12, %rsp, %rax, %rbx) /* Uses label 9 */
84 64 TRACE_STAMP(%r12) /* Clobbers %eax, %edx, uses 9 */
85 65
86 66 movq %rsp, %rbp
87 67
88 68 TRACE_STACK(%r12)
89 69
90 70 #ifdef TRAPTRACE
91 71 LOADCPU(%rbx) /* &cpu */
92 72 movl CPU_PRI(%rbx), %r14d /* old ipl */
93 73 movl $255, TTR_IPL(%r12)
94 74 movl %r14d, %edi
95 75 movb %dil, TTR_PRI(%r12)
96 76 movl CPU_BASE_SPL(%rbx), %edi
97 77 movb %dil, TTR_SPL(%r12)
98 78 movb $255, TTR_VECTOR(%r12)
99 79 movq %r12, %rsi /* pass traptrace record pointer */
100 80 #endif
101 81
↓ open down ↓ |
24 lines elided |
↑ open up ↑ |
102 82 movq %rsp, %rdi /* pass struct regs pointer */
103 83 movq do_interrupt_common, %rax
104 84 INDIRECT_CALL_REG(rax)
105 85
106 86 jmp _sys_rtt_ints_disabled
107 87 /*NOTREACHED*/
108 88
109 89 SET_SIZE(cmnint)
110 90 SET_SIZE(_interrupt)
111 91
112 -#elif defined(__i386)
113 -
114 - ENTRY_NP2(cmnint, _interrupt)
115 -
116 - INTR_PUSH
117 - INTGATE_INIT_KERNEL_FLAGS
118 -
119 - /*
120 - * At the end of TRACE_PTR %esi points to the current TRAPTRACE entry
121 - */
122 - TRACE_PTR(%esi, %eax, %eax, %edx, $TT_INTERRUPT)
123 - /* Uses labels 8 and 9 */
124 - TRACE_REGS(%esi, %esp, %eax, %ebx) /* Uses label 9 */
125 - TRACE_STAMP(%esi) /* Clobbers %eax, %edx, uses 9 */
126 -
127 - movl %esp, %ebp
128 -
129 - TRACE_STACK(%esi)
130 -
131 - pushl %esi /* pass traptrace record pointer */
132 - pushl %ebp /* pass struct regs pointer */
133 - call *do_interrupt_common /* interrupt service routine */
134 - addl $8, %esp /* pop args off of stack */
135 -
136 - jmp _sys_rtt_ints_disabled
137 - /*NOTREACHED*/
138 -
139 - SET_SIZE(cmnint)
140 - SET_SIZE(_interrupt)
141 -
142 -#endif /* __i386 */
143 -
144 92 /*
145 93 * Declare a uintptr_t which has the size of _interrupt to enable stack
146 94 * traceback code to know when a regs structure is on the stack.
147 95 */
148 96 .globl _interrupt_size
149 97 .align CLONGSIZE
150 98 _interrupt_size:
151 99 .NWORD . - _interrupt
152 100 .type _interrupt_size, @object
153 101
154 -#endif /* __lint */
155 -
156 -#if defined(__lint)
157 -
158 -void
159 -fakesoftint(void)
160 -{}
161 -
162 -#else /* __lint */
163 -
164 - /
165 - / If we're here, we're being called from splx() to fake a soft
166 - / interrupt (note that interrupts are still disabled from splx()).
167 - / We execute this code when a soft interrupt is posted at
168 - / level higher than the CPU's current spl; when spl is lowered in
169 - / splx(), it will see the softint and jump here. We'll do exactly
170 - / what a trap would do: push our flags, %cs, %eip, error code
171 - / and trap number (T_SOFTINT). The cmnint() code will see T_SOFTINT
172 - / and branch to the dosoftint() code.
173 - /
174 -#if defined(__amd64)
175 -
176 102 /*
177 - * In 64-bit mode, iretq -always- pops all five regs
178 - * Imitate the 16-byte auto-align of the stack, and the
179 - * zero-ed out %ss value.
103 + * If we're here, we're being called from splx() to fake a soft
104 + * interrupt (note that interrupts are still disabled from
105 + * splx()). We execute this code when a soft interrupt is
106 + * posted at level higher than the CPU's current spl; when spl
107 + * is lowered in splx(), it will see the softint and jump here.
108 + * We'll do exactly what a trap would do: push our flags, %cs,
109 + * %rip, error code and trap number (T_SOFTINT). The cmnint()
110 + * code will see T_SOFTINT and branch to the dosoftint() code.
111 + *
112 + * iretq -always- pops all five regs. Imitate the 16-byte
113 + * auto-align of the stack, and the zero-ed out %ss value.
180 114 */
115 +
181 116 ENTRY_NP(fakesoftint)
182 117 movq %rsp, %r11
183 118 andq $-16, %rsp
184 119 pushq $KDS_SEL /* %ss */
185 120 pushq %r11 /* %rsp */
186 121 pushf /* rflags */
187 122 #if defined(__xpv)
188 123 popq %r11
189 124 EVENT_MASK_TO_IE(%rdi, %r11)
190 125 pushq %r11
191 126 #endif
192 127 pushq $KCS_SEL /* %cs */
↓ open down ↓ |
2 lines elided |
↑ open up ↑ |
193 128 leaq fakesoftint_return(%rip), %r11
194 129 pushq %r11 /* %rip */
195 130 pushq $0 /* err */
196 131 pushq $T_SOFTINT /* trap */
197 132 jmp cmnint
198 133 ALTENTRY(fakesoftint_return)
199 134 ret
200 135 SET_SIZE(fakesoftint_return)
201 136 SET_SIZE(fakesoftint)
202 137
203 -#elif defined(__i386)
204 -
205 - ENTRY_NP(fakesoftint)
206 - pushfl
207 -#if defined(__xpv)
208 - popl %eax
209 - EVENT_MASK_TO_IE(%edx, %eax)
210 - pushl %eax
211 -#endif
212 - pushl %cs
213 - pushl $fakesoftint_return
214 - pushl $0
215 - pushl $T_SOFTINT
216 - jmp cmnint
217 - ALTENTRY(fakesoftint_return)
218 - ret
219 - SET_SIZE(fakesoftint_return)
220 - SET_SIZE(fakesoftint)
221 -
222 -#endif /* __i386 */
223 -#endif /* __lint */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX