Print this page
5606 support build with binutils 2.25
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Reviewed by: Marcel Telka <marcel.telka@nexenta.com>
Reviewed by: Piotr Jasiukajtis <estibi@me.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/intel/ia32/ml/desctbls_asm.s
+++ new/usr/src/uts/intel/ia32/ml/desctbls_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
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
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 2007 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25
26 -#pragma ident "%Z%%M% %I% %E% SMI"
27 -
28 26 #include <sys/asm_linkage.h>
29 27 #include <sys/asm_misc.h>
30 28 #include <sys/regset.h>
31 29 #include <sys/panic.h>
32 30 #include <sys/ontrap.h>
33 31 #include <sys/privregs.h>
34 32 #include <sys/segments.h>
35 33 #include <sys/trap.h>
36 34
37 35 #if defined(__lint)
38 36 #include <sys/types.h>
39 37 #include <sys/systm.h>
40 38 #include <sys/thread.h>
41 39 #include <sys/archsystm.h>
42 40 #include <sys/byteorder.h>
43 41 #include <sys/dtrace.h>
44 42 #include <sys/x86_archext.h>
45 43 #else /* __lint */
46 44 #include "assym.h"
47 45 #endif /* __lint */
48 46
49 47 #if defined(__lint)
50 48
51 49 /*ARGSUSED*/
52 50 void
53 51 rd_idtr(desctbr_t *idtr)
54 52 {}
55 53
56 54 /*ARGSUSED*/
57 55 void
58 56 wr_idtr(desctbr_t *idtr)
59 57 {}
60 58
61 59 #else /* __lint */
62 60
63 61 #if defined(__amd64)
64 62
65 63 ENTRY_NP(rd_idtr)
66 64 sidt (%rdi)
67 65 ret
68 66 SET_SIZE(rd_idtr)
69 67
70 68 ENTRY_NP(wr_idtr)
71 69 lidt (%rdi)
72 70 ret
73 71 SET_SIZE(wr_idtr)
74 72
75 73 #elif defined(__i386)
76 74
77 75 ENTRY_NP(rd_idtr)
78 76 pushl %ebp
79 77 movl %esp, %ebp
80 78 movl 8(%ebp), %edx
81 79 sidt (%edx)
82 80 leave
83 81 ret
84 82 SET_SIZE(rd_idtr)
85 83
86 84 ENTRY_NP(wr_idtr)
87 85 pushl %ebp
88 86 movl %esp, %ebp
89 87 movl 8(%ebp), %edx
90 88 lidt (%edx)
91 89 leave
92 90 ret
93 91 SET_SIZE(wr_idtr)
94 92
95 93 #endif /* __i386 */
96 94 #endif /* __lint */
97 95
98 96 #if defined(__lint)
99 97
100 98 /*ARGSUSED*/
101 99 void
102 100 rd_gdtr(desctbr_t *gdtr)
103 101 {}
104 102
105 103 /*ARGSUSED*/
106 104 void
107 105 wr_gdtr(desctbr_t *gdtr)
108 106 {}
109 107
110 108 #else /* __lint */
111 109
112 110 #if defined(__amd64)
113 111
114 112 ENTRY_NP(rd_gdtr)
115 113 pushq %rbp
116 114 movq %rsp, %rbp
117 115 sgdt (%rdi)
118 116 leave
119 117 ret
120 118 SET_SIZE(rd_gdtr)
121 119
122 120 ENTRY_NP(wr_gdtr)
123 121 pushq %rbp
124 122 movq %rsp, %rbp
125 123 lgdt (%rdi)
126 124 jmp 1f
127 125 nop
128 126 1:
129 127 leave
130 128 ret
131 129 SET_SIZE(wr_gdtr)
132 130
133 131 #elif defined(__i386)
134 132
135 133 ENTRY_NP(rd_gdtr)
136 134 pushl %ebp
137 135 movl %esp, %ebp
138 136 movl 8(%ebp), %edx
139 137 sgdt (%edx)
140 138 leave
141 139 ret
142 140 SET_SIZE(rd_gdtr)
143 141
144 142 ENTRY_NP(wr_gdtr)
145 143 pushl %ebp
146 144 movl %esp, %ebp
147 145 movl 8(%ebp), %edx
148 146 lgdt (%edx)
149 147 jmp 1f
150 148 nop
151 149 1:
152 150 leave
153 151 ret
154 152 SET_SIZE(wr_gdtr)
155 153
156 154 #endif /* __i386 */
157 155 #endif /* __lint */
158 156
159 157 #if defined(__amd64)
160 158 #if defined(__lint)
161 159
162 160 /*ARGSUSED*/
163 161 void
164 162 load_segment_registers(selector_t cs, selector_t fs, selector_t gs,
165 163 selector_t ss)
166 164 {}
167 165
168 166 selector_t
169 167 get_cs_register()
170 168 { return (0); }
171 169
172 170 #else /* __lint */
173 171
174 172 /*
175 173 * loads zero selector for ds and es.
176 174 */
177 175 ENTRY_NP(load_segment_registers)
178 176 pushq %rbp
179 177 movq %rsp, %rbp
180 178 pushq %rdi
181 179 pushq $.newcs
182 180 lretq
183 181 .newcs:
184 182 /*
185 183 * zero %ds and %es - they're ignored anyway
186 184 */
187 185 xorl %eax, %eax
188 186 movw %ax, %ds
189 187 movw %ax, %es
190 188 movl %esi, %eax
↓ open down ↓ |
153 lines elided |
↑ open up ↑ |
191 189 movw %ax, %fs
192 190 movl %edx, %eax
193 191 movw %ax, %gs
194 192 movl %ecx, %eax
195 193 movw %ax, %ss
196 194 leave
197 195 ret
198 196 SET_SIZE(load_segment_registers)
199 197
200 198 ENTRY_NP(get_cs_register)
201 - movq $0, %rax
202 - movw %cs, %rax
199 + movq %cs, %rax
203 200 ret
204 201 SET_SIZE(get_cs_register)
205 202
206 203 #endif /* __lint */
207 204 #elif defined(__i386)
208 205
209 206 #if defined(__lint)
210 207
211 208 /*ARGSUSED*/
212 209 void
213 210 load_segment_registers(
214 211 selector_t cs, selector_t ds, selector_t es,
215 212 selector_t fs, selector_t gs, selector_t ss)
216 213 {}
217 214
218 215 selector_t
219 216 get_cs_register()
220 217 { return ((selector_t) 0); }
221 218
222 219 #else /* __lint */
223 220
224 221 ENTRY_NP(load_segment_registers)
225 222 pushl %ebp
226 223 movl %esp, %ebp
227 224
228 225 pushl 0x8(%ebp)
229 226 pushl $.newcs
230 227 lret
231 228 .newcs:
232 229 movw 0xc(%ebp), %ax
233 230 movw %ax, %ds
234 231 movw 0x10(%ebp), %ax
235 232 movw %ax, %es
236 233 movw 0x14(%ebp), %ax
237 234 movw %ax, %fs
238 235 movw 0x18(%ebp), %ax
239 236 movw %ax, %gs
240 237 movw 0x1c(%ebp), %ax
241 238 movw %ax, %ss
242 239 leave
243 240 ret
244 241 SET_SIZE(load_segment_registers)
245 242
246 243 ENTRY_NP(get_cs_register)
247 244 movl $0, %eax
248 245 movw %cs, %ax
249 246 ret
250 247 SET_SIZE(get_cs_register)
251 248
252 249 #endif /* __lint */
253 250 #endif /* __i386 */
254 251
255 252 #if defined(__lint)
256 253
257 254 /*ARGSUSED*/
258 255 void
259 256 wr_ldtr(selector_t ldtsel)
260 257 {}
261 258
262 259 selector_t
263 260 rd_ldtr(void)
264 261 { return (0); }
265 262
266 263 #else /* __lint */
267 264
268 265 #if defined(__amd64)
269 266
270 267 ENTRY_NP(wr_ldtr)
271 268 movq %rdi, %rax
272 269 lldt %ax
273 270 ret
274 271 SET_SIZE(wr_ldtr)
275 272
276 273 ENTRY_NP(rd_ldtr)
277 274 xorl %eax, %eax
278 275 sldt %ax
279 276 ret
280 277 SET_SIZE(rd_ldtr)
281 278
282 279 #elif defined(__i386)
283 280
284 281 ENTRY_NP(wr_ldtr)
285 282 movw 4(%esp), %ax
286 283 lldt %ax
287 284 ret
288 285 SET_SIZE(wr_ldtr)
289 286
290 287 ENTRY_NP(rd_ldtr)
291 288 xorl %eax, %eax
292 289 sldt %ax
293 290 ret
294 291 SET_SIZE(rd_ldtr)
295 292
296 293 #endif /* __i386 */
297 294 #endif /* __lint */
298 295
299 296 #if defined(__lint)
300 297
301 298 /*ARGSUSED*/
302 299 void
303 300 wr_tsr(selector_t tsssel)
304 301 {}
305 302
306 303 #else /* __lint */
307 304
308 305 #if defined(__amd64)
309 306
310 307 ENTRY_NP(wr_tsr)
311 308 movq %rdi, %rax
312 309 ltr %ax
313 310 ret
314 311 SET_SIZE(wr_tsr)
315 312
316 313 #elif defined(__i386)
317 314
318 315 ENTRY_NP(wr_tsr)
319 316 movw 4(%esp), %ax
320 317 ltr %ax
321 318 ret
322 319 SET_SIZE(wr_tsr)
323 320
324 321 #endif /* __i386 */
325 322 #endif /* __lint */
↓ open down ↓ |
113 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX