Print this page
11787 Kernel needs to be built with retpolines
11788 Kernel needs to generally use RSB stuffing
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: John Levon <john.levon@joyent.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/intel/ia32/ml/ddi_i86_asm.s
+++ new/usr/src/uts/intel/ia32/ml/ddi_i86_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 2005 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"
27 +/*
28 + * Copyright 2019 Joyent, Inc.
29 + */
28 30
29 31 #if defined(lint) || defined(__lint)
30 32 #include <sys/types.h>
31 33 #include <sys/sunddi.h>
32 34 #else
33 35 #include <sys/asm_linkage.h>
34 36 #include <sys/asm_misc.h>
35 37 #include "assym.h"
36 38 #endif
37 39
38 40 #if defined(lint) || defined(__lint)
39 41
40 42 /*ARGSUSED*/
41 43 uint8_t
42 44 ddi_get8(ddi_acc_handle_t handle, uint8_t *addr)
43 45 {
44 46 return (0);
45 47 }
46 48
47 49 /*ARGSUSED*/
48 50 uint8_t
49 51 ddi_mem_get8(ddi_acc_handle_t handle, uint8_t *addr)
50 52 {
51 53 return (0);
52 54 }
53 55
54 56 /*ARGSUSED*/
55 57 uint8_t
56 58 ddi_io_get8(ddi_acc_handle_t handle, uint8_t *dev_addr)
57 59 {
58 60 return (0);
59 61 }
60 62
61 63 /*ARGSUSED*/
62 64 uint16_t
63 65 ddi_get16(ddi_acc_handle_t handle, uint16_t *addr)
64 66 {
65 67 return (0);
66 68 }
67 69
68 70 /*ARGSUSED*/
69 71 uint16_t
70 72 ddi_mem_get16(ddi_acc_handle_t handle, uint16_t *addr)
71 73 {
72 74 return (0);
73 75 }
74 76
75 77 /*ARGSUSED*/
76 78 uint16_t
77 79 ddi_io_get16(ddi_acc_handle_t handle, uint16_t *dev_addr)
78 80 {
79 81 return (0);
80 82 }
81 83
82 84 /*ARGSUSED*/
83 85 uint32_t
84 86 ddi_get32(ddi_acc_handle_t handle, uint32_t *addr)
85 87 {
86 88 return (0);
87 89 }
88 90
89 91 /*ARGSUSED*/
90 92 uint32_t
91 93 ddi_mem_get32(ddi_acc_handle_t handle, uint32_t *addr)
92 94 {
93 95 return (0);
94 96 }
95 97
96 98 /*ARGSUSED*/
97 99 uint32_t
98 100 ddi_io_get32(ddi_acc_handle_t handle, uint32_t *dev_addr)
99 101 {
100 102 return (0);
101 103 }
102 104
103 105 /*ARGSUSED*/
104 106 uint64_t
105 107 ddi_get64(ddi_acc_handle_t handle, uint64_t *addr)
106 108 {
107 109 return (0);
108 110 }
109 111
110 112 /*ARGSUSED*/
111 113 uint64_t
112 114 ddi_mem_get64(ddi_acc_handle_t handle, uint64_t *addr)
113 115 {
114 116 return (0);
115 117 }
116 118
117 119 /*ARGSUSED*/
118 120 void
119 121 ddi_put8(ddi_acc_handle_t handle, uint8_t *addr, uint8_t value)
120 122 {}
121 123
122 124 /*ARGSUSED*/
123 125 void
124 126 ddi_mem_put8(ddi_acc_handle_t handle, uint8_t *dev_addr, uint8_t value)
125 127 {}
126 128
127 129 /*ARGSUSED*/
128 130 void
129 131 ddi_io_put8(ddi_acc_handle_t handle, uint8_t *dev_addr, uint8_t value)
130 132 {}
131 133
132 134 /*ARGSUSED*/
133 135 void
134 136 ddi_put16(ddi_acc_handle_t handle, uint16_t *addr, uint16_t value)
135 137 {}
136 138
137 139 /*ARGSUSED*/
138 140 void
139 141 ddi_mem_put16(ddi_acc_handle_t handle, uint16_t *dev_addr, uint16_t value)
140 142 {}
141 143
142 144 /*ARGSUSED*/
143 145 void
144 146 ddi_io_put16(ddi_acc_handle_t handle, uint16_t *dev_addr, uint16_t value)
145 147 {}
146 148
147 149 /*ARGSUSED*/
148 150 void
149 151 ddi_put32(ddi_acc_handle_t handle, uint32_t *addr, uint32_t value)
150 152 {}
151 153
152 154 /*ARGSUSED*/
153 155 void
154 156 ddi_mem_put32(ddi_acc_handle_t handle, uint32_t *dev_addr, uint32_t value)
155 157 {}
156 158
157 159 /*ARGSUSED*/
158 160 void
159 161 ddi_io_put32(ddi_acc_handle_t handle, uint32_t *dev_addr, uint32_t value)
160 162 {}
161 163
162 164 /*ARGSUSED*/
163 165 void
164 166 ddi_put64(ddi_acc_handle_t handle, uint64_t *addr, uint64_t value)
165 167 {}
166 168
167 169 /*ARGSUSED*/
168 170 void
169 171 ddi_mem_put64(ddi_acc_handle_t handle, uint64_t *dev_addr, uint64_t value)
170 172 {}
171 173
172 174 /*ARGSUSED*/
173 175 void
174 176 ddi_rep_get8(ddi_acc_handle_t handle, uint8_t *host_addr, uint8_t *dev_addr,
175 177 size_t repcount, uint_t flags)
176 178 {}
177 179
178 180 /*ARGSUSED*/
179 181 void
180 182 ddi_rep_get16(ddi_acc_handle_t handle, uint16_t *host_addr, uint16_t *dev_addr,
181 183 size_t repcount, uint_t flags)
182 184 {}
183 185
184 186 /*ARGSUSED*/
185 187 void
186 188 ddi_rep_get32(ddi_acc_handle_t handle, uint32_t *host_addr, uint32_t *dev_addr,
187 189 size_t repcount, uint_t flags)
188 190 {}
189 191
190 192 /*ARGSUSED*/
191 193 void
192 194 ddi_rep_get64(ddi_acc_handle_t handle, uint64_t *host_addr, uint64_t *dev_addr,
193 195 size_t repcount, uint_t flags)
194 196 {}
195 197
196 198 /*ARGSUSED*/
197 199 void
198 200 ddi_rep_put8(ddi_acc_handle_t handle, uint8_t *host_addr, uint8_t *dev_addr,
199 201 size_t repcount, uint_t flags)
200 202 {}
201 203
202 204 /*ARGSUSED*/
203 205 void
204 206 ddi_rep_put16(ddi_acc_handle_t handle, uint16_t *host_addr, uint16_t *dev_addr,
205 207 size_t repcount, uint_t flags)
206 208 {}
207 209
208 210 /*ARGSUSED*/
209 211 void
210 212 ddi_rep_put32(ddi_acc_handle_t handle, uint32_t *host_addr, uint32_t *dev_addr,
211 213 size_t repcount, uint_t flags)
212 214 {}
213 215
214 216 /*ARGSUSED*/
215 217 void
216 218 ddi_rep_put64(ddi_acc_handle_t handle, uint64_t *host_addr, uint64_t *dev_addr,
217 219 size_t repcount, uint_t flags)
218 220 {}
219 221
220 222 /*ARGSUSED*/
221 223 void
222 224 ddi_mem_rep_get8(ddi_acc_handle_t handle, uint8_t *host_addr,
223 225 uint8_t *dev_addr, size_t repcount, uint_t flags)
224 226 {}
225 227
226 228 /*ARGSUSED*/
227 229 void
228 230 ddi_mem_rep_get16(ddi_acc_handle_t handle, uint16_t *host_addr,
229 231 uint16_t *dev_addr, size_t repcount, uint_t flags)
230 232 {}
231 233
232 234 /*ARGSUSED*/
233 235 void
234 236 ddi_mem_rep_get32(ddi_acc_handle_t handle, uint32_t *host_addr,
235 237 uint32_t *dev_addr, size_t repcount, uint_t flags)
236 238 {}
237 239
238 240 /*ARGSUSED*/
239 241 void
240 242 ddi_mem_rep_get64(ddi_acc_handle_t handle, uint64_t *host_addr,
241 243 uint64_t *dev_addr, size_t repcount, uint_t flags)
242 244 {}
243 245
244 246 /*ARGSUSED*/
245 247 void
246 248 ddi_mem_rep_put8(ddi_acc_handle_t handle, uint8_t *host_addr,
247 249 uint8_t *dev_addr, size_t repcount, uint_t flags)
248 250 {}
249 251
250 252 /*ARGSUSED*/
251 253 void
252 254 ddi_mem_rep_put16(ddi_acc_handle_t handle, uint16_t *host_addr,
253 255 uint16_t *dev_addr, size_t repcount, uint_t flags)
254 256 {}
255 257
256 258 /*ARGSUSED*/
257 259 void
258 260 ddi_mem_rep_put32(ddi_acc_handle_t handle, uint32_t *host_addr,
259 261 uint32_t *dev_addr, size_t repcount, uint_t flags)
↓ open down ↓ |
222 lines elided |
↑ open up ↑ |
260 262 {}
261 263
262 264 /*ARGSUSED*/
263 265 void
264 266 ddi_mem_rep_put64(ddi_acc_handle_t handle, uint64_t *host_addr,
265 267 uint64_t *dev_addr, size_t repcount, uint_t flags)
266 268 {}
267 269
268 270 #else /* lint */
269 271
270 -
272 +
271 273 #if defined(__amd64)
272 274
273 275 ENTRY(ddi_get8)
274 276 ALTENTRY(ddi_getb)
275 277 ALTENTRY(ddi_mem_getb)
276 278 ALTENTRY(ddi_mem_get8)
277 279 ALTENTRY(ddi_io_getb)
278 280 ALTENTRY(ddi_io_get8)
279 281 movl ACC_ATTR(%rdi), %edx
280 282 cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %edx
281 283 jne 1f
↓ open down ↓ |
1 lines elided |
↑ open up ↑ |
282 284 movq %rsi, %rdx
283 285 xorq %rax, %rax
284 286 inb (%dx)
285 287 ret
286 288 1:
287 289 cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %edx
288 290 jne 2f
289 291 movzbq (%rsi), %rax
290 292 ret
291 293 2:
292 - jmp *ACC_GETB(%rdi)
294 + movq ACC_GETB(%rdi), %rax
295 + INDIRECT_JMP_REG(rax)
293 296 SET_SIZE(ddi_get8)
294 297 SET_SIZE(ddi_getb)
295 298 SET_SIZE(ddi_mem_getb)
296 299 SET_SIZE(ddi_mem_get8)
297 300 SET_SIZE(ddi_io_getb)
298 301 SET_SIZE(ddi_io_get8)
299 302
300 303 #elif defined(__i386)
301 304
302 305 ENTRY(ddi_get8)
303 306 ALTENTRY(ddi_getb)
304 307 ALTENTRY(ddi_mem_getb)
305 308 ALTENTRY(ddi_mem_get8)
306 309 ALTENTRY(ddi_io_getb)
307 310 ALTENTRY(ddi_io_get8)
308 311 movl 4(%esp), %eax
309 312 movl ACC_ATTR(%eax), %ecx
310 313 cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %ecx
311 314 jne 1f
312 315 movl 8(%esp), %edx
313 316 xorl %eax, %eax
314 317 inb (%dx)
315 318 ret
316 319 1:
317 320 cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %ecx
318 321 jne 2f
319 322 movl 8(%esp), %eax
320 323 movzbl (%eax), %eax
321 324 ret
322 325 2:
323 326 jmp *ACC_GETB(%eax)
324 327 SET_SIZE(ddi_get8)
325 328 SET_SIZE(ddi_getb)
326 329 SET_SIZE(ddi_mem_getb)
327 330 SET_SIZE(ddi_mem_get8)
328 331 SET_SIZE(ddi_io_getb)
329 332 SET_SIZE(ddi_io_get8)
330 333
331 334 #endif /* __i386 */
332 335
333 336 #if defined(__amd64)
334 337
335 338 ENTRY(ddi_get16)
336 339 ALTENTRY(ddi_getw)
337 340 ALTENTRY(ddi_mem_getw)
338 341 ALTENTRY(ddi_mem_get16)
339 342 ALTENTRY(ddi_io_getw)
340 343 ALTENTRY(ddi_io_get16)
341 344 movl ACC_ATTR(%rdi), %edx
342 345 cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %edx
343 346 jne 3f
↓ open down ↓ |
41 lines elided |
↑ open up ↑ |
344 347 movq %rsi, %rdx
345 348 xorq %rax, %rax
346 349 inw (%dx)
347 350 ret
348 351 3:
349 352 cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %edx
350 353 jne 4f
351 354 movzwq (%rsi), %rax
352 355 ret
353 356 4:
354 - jmp *ACC_GETW(%rdi)
357 + movq ACC_GETW(%rdi), %rax
358 + INDIRECT_JMP_REG(rax)
355 359 SET_SIZE(ddi_get16)
356 360 SET_SIZE(ddi_getw)
357 361 SET_SIZE(ddi_mem_getw)
358 362 SET_SIZE(ddi_mem_get16)
359 363 SET_SIZE(ddi_io_getw)
360 364 SET_SIZE(ddi_io_get16)
361 365
362 366 #elif defined(__i386)
363 367
364 368 ENTRY(ddi_get16)
365 369 ALTENTRY(ddi_getw)
366 370 ALTENTRY(ddi_mem_getw)
367 371 ALTENTRY(ddi_mem_get16)
368 372 ALTENTRY(ddi_io_getw)
369 373 ALTENTRY(ddi_io_get16)
370 374 movl 4(%esp), %eax
371 375 movl ACC_ATTR(%eax), %ecx
372 376 cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %ecx
373 377 jne 3f
374 378 movl 8(%esp), %edx
375 379 xorl %eax, %eax
376 380 inw (%dx)
377 381 ret
378 382 3:
379 383 cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %ecx
380 384 jne 4f
381 385 movl 8(%esp), %eax
382 386 movzwl (%eax), %eax
383 387 ret
384 388 4:
385 389 jmp *ACC_GETW(%eax)
386 390 SET_SIZE(ddi_get16)
387 391 SET_SIZE(ddi_getw)
388 392 SET_SIZE(ddi_mem_getw)
389 393 SET_SIZE(ddi_mem_get16)
390 394 SET_SIZE(ddi_io_getw)
391 395 SET_SIZE(ddi_io_get16)
392 396
393 397 #endif /* __i386 */
394 398
395 399 #if defined(__amd64)
396 400
397 401 ENTRY(ddi_get32)
398 402 ALTENTRY(ddi_getl)
399 403 ALTENTRY(ddi_mem_getl)
400 404 ALTENTRY(ddi_mem_get32)
401 405 ALTENTRY(ddi_io_getl)
402 406 ALTENTRY(ddi_io_get32)
403 407 movl ACC_ATTR(%rdi), %edx
404 408 cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %edx
↓ open down ↓ |
40 lines elided |
↑ open up ↑ |
405 409 jne 5f
406 410 movq %rsi, %rdx
407 411 inl (%dx)
408 412 ret
409 413 5:
410 414 cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %edx
411 415 jne 6f
412 416 movl (%rsi), %eax
413 417 ret
414 418 6:
415 - jmp *ACC_GETL(%rdi)
419 + movq ACC_GETL(%rdi), %rax
420 + INDIRECT_JMP_REG(rax)
416 421 SET_SIZE(ddi_get32)
417 422 SET_SIZE(ddi_getl)
418 423 SET_SIZE(ddi_mem_getl)
419 424 SET_SIZE(ddi_mem_get32)
420 425 SET_SIZE(ddi_io_getl)
421 426 SET_SIZE(ddi_io_get32)
422 427
423 428 #elif defined(__i386)
424 429
425 430 ENTRY(ddi_get32)
426 431 ALTENTRY(ddi_getl)
427 432 ALTENTRY(ddi_mem_getl)
428 433 ALTENTRY(ddi_mem_get32)
429 434 ALTENTRY(ddi_io_getl)
430 435 ALTENTRY(ddi_io_get32)
431 436 movl 4(%esp), %eax
432 437 movl ACC_ATTR(%eax), %ecx
433 438 cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %ecx
434 439 jne 5f
435 440 movl 8(%esp), %edx
436 441 inl (%dx)
437 442 ret
438 443 5:
439 444 cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %ecx
440 445 jne 6f
441 446 movl 8(%esp), %eax
442 447 movl (%eax), %eax
443 448 ret
444 449 6:
445 450 jmp *ACC_GETL(%eax)
446 451 SET_SIZE(ddi_get32)
447 452 SET_SIZE(ddi_getl)
448 453 SET_SIZE(ddi_mem_getl)
449 454 SET_SIZE(ddi_mem_get32)
450 455 SET_SIZE(ddi_io_getl)
↓ open down ↓ |
25 lines elided |
↑ open up ↑ |
451 456 SET_SIZE(ddi_io_get32)
452 457
453 458 #endif /* __i386 */
454 459
455 460 #if defined(__amd64)
456 461
457 462 ENTRY(ddi_get64)
458 463 ALTENTRY(ddi_getll)
459 464 ALTENTRY(ddi_mem_getll)
460 465 ALTENTRY(ddi_mem_get64)
461 - jmp *ACC_GETLL(%rdi)
466 + movq ACC_GETLL(%rdi), %rax
467 + INDIRECT_JMP_REG(rax)
462 468 SET_SIZE(ddi_get64)
463 469 SET_SIZE(ddi_getll)
464 470 SET_SIZE(ddi_mem_getll)
465 471 SET_SIZE(ddi_mem_get64)
466 472
467 473 #elif defined(__i386)
468 474
469 475 ENTRY(ddi_get64)
470 476 ALTENTRY(ddi_getll)
471 477 ALTENTRY(ddi_mem_getll)
472 478 ALTENTRY(ddi_mem_get64)
473 479 movl 4(%esp), %eax
474 480 jmp *ACC_GETLL(%eax)
475 481 SET_SIZE(ddi_get64)
476 482 SET_SIZE(ddi_getll)
477 483 SET_SIZE(ddi_mem_getll)
478 484 SET_SIZE(ddi_mem_get64)
479 485
480 486 #endif /* __i386 */
481 487
482 488 #if defined(__amd64)
483 489
484 490 ENTRY(ddi_put8)
485 491 ALTENTRY(ddi_putb)
486 492 ALTENTRY(ddi_mem_putb)
487 493 ALTENTRY(ddi_mem_put8)
488 494 ALTENTRY(ddi_io_putb)
489 495 ALTENTRY(ddi_io_put8)
490 496 movl ACC_ATTR(%rdi), %ecx
491 497 cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %ecx
492 498 jne 7f
↓ open down ↓ |
21 lines elided |
↑ open up ↑ |
493 499 movq %rdx, %rax
494 500 movq %rsi, %rdx
495 501 outb (%dx)
496 502 ret
497 503 7:
498 504 cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %ecx
499 505 jne 8f
500 506 movb %dl, (%rsi)
501 507 ret
502 508 8:
503 - jmp *ACC_PUTB(%rdi)
509 + movq ACC_PUTB(%rdi), %rax
510 + INDIRECT_JMP_REG(rax)
504 511 SET_SIZE(ddi_put8)
505 512 SET_SIZE(ddi_putb)
506 513 SET_SIZE(ddi_mem_putb)
507 514 SET_SIZE(ddi_mem_put8)
508 515 SET_SIZE(ddi_io_putb)
509 516 SET_SIZE(ddi_io_put8)
510 517
511 518 #elif defined(__i386)
512 519
513 520 ENTRY(ddi_put8)
514 521 ALTENTRY(ddi_putb)
515 522 ALTENTRY(ddi_mem_putb)
516 523 ALTENTRY(ddi_mem_put8)
517 524 ALTENTRY(ddi_io_putb)
518 525 ALTENTRY(ddi_io_put8)
519 526 movl 4(%esp), %eax
520 527 movl ACC_ATTR(%eax), %ecx
521 528 cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %ecx
522 529 jne 7f
523 530 movl 12(%esp), %eax
524 531 movl 8(%esp), %edx
525 532 outb (%dx)
526 533 ret
527 534 7:
528 535 cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %ecx
529 536 jne 8f
530 537 movl 8(%esp), %eax
531 538 movl 12(%esp), %ecx
532 539 movb %cl, (%eax)
533 540 ret
534 541 8:
535 542 jmp *ACC_PUTB(%eax)
536 543 SET_SIZE(ddi_put8)
537 544 SET_SIZE(ddi_putb)
538 545 SET_SIZE(ddi_mem_putb)
539 546 SET_SIZE(ddi_mem_put8)
540 547 SET_SIZE(ddi_io_putb)
541 548 SET_SIZE(ddi_io_put8)
542 549
543 550 #endif /* __i386 */
544 551
545 552 #if defined(__amd64)
546 553
547 554 ENTRY(ddi_put16)
548 555 ALTENTRY(ddi_putw)
549 556 ALTENTRY(ddi_mem_putw)
550 557 ALTENTRY(ddi_mem_put16)
551 558 ALTENTRY(ddi_io_putw)
552 559 ALTENTRY(ddi_io_put16)
553 560 movl ACC_ATTR(%rdi), %ecx
554 561 cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %ecx
555 562 jne 8f
↓ open down ↓ |
42 lines elided |
↑ open up ↑ |
556 563 movq %rdx, %rax
557 564 movq %rsi, %rdx
558 565 outw (%dx)
559 566 ret
560 567 8:
561 568 cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %ecx
562 569 jne 9f
563 570 movw %dx, (%rsi)
564 571 ret
565 572 9:
566 - jmp *ACC_PUTW(%rdi)
573 + movq ACC_PUTW(%rdi), %rax
574 + INDIRECT_JMP_REG(rax)
567 575 SET_SIZE(ddi_put16)
568 576 SET_SIZE(ddi_putw)
569 577 SET_SIZE(ddi_mem_putw)
570 578 SET_SIZE(ddi_mem_put16)
571 579 SET_SIZE(ddi_io_putw)
572 580 SET_SIZE(ddi_io_put16)
573 581
574 582 #elif defined(__i386)
575 583
576 584 ENTRY(ddi_put16)
577 585 ALTENTRY(ddi_putw)
578 586 ALTENTRY(ddi_mem_putw)
579 587 ALTENTRY(ddi_mem_put16)
580 588 ALTENTRY(ddi_io_putw)
581 589 ALTENTRY(ddi_io_put16)
582 590 movl 4(%esp), %eax
583 591 movl ACC_ATTR(%eax), %ecx
584 592 cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %ecx
585 593 jne 8f
586 594 movl 12(%esp), %eax
587 595 movl 8(%esp), %edx
588 596 outw (%dx)
589 597 ret
590 598 8:
591 599 cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %ecx
592 600 jne 9f
593 601 movl 8(%esp), %eax
594 602 movl 12(%esp), %ecx
595 603 movw %cx, (%eax)
596 604 ret
597 605 9:
598 606 jmp *ACC_PUTW(%eax)
599 607 SET_SIZE(ddi_put16)
600 608 SET_SIZE(ddi_putw)
601 609 SET_SIZE(ddi_mem_putw)
602 610 SET_SIZE(ddi_mem_put16)
603 611 SET_SIZE(ddi_io_putw)
604 612 SET_SIZE(ddi_io_put16)
605 613
606 614 #endif /* __i386 */
607 615
608 616 #if defined(__amd64)
609 617
610 618 ENTRY(ddi_put32)
611 619 ALTENTRY(ddi_putl)
612 620 ALTENTRY(ddi_mem_putl)
613 621 ALTENTRY(ddi_mem_put32)
614 622 ALTENTRY(ddi_io_putl)
615 623 ALTENTRY(ddi_io_put32)
616 624 movl ACC_ATTR(%rdi), %ecx
617 625 cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %ecx
618 626 jne 8f
↓ open down ↓ |
42 lines elided |
↑ open up ↑ |
619 627 movq %rdx, %rax
620 628 movq %rsi, %rdx
621 629 outl (%dx)
622 630 ret
623 631 8:
624 632 cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %ecx
625 633 jne 9f
626 634 movl %edx, (%rsi)
627 635 ret
628 636 9:
629 - jmp *ACC_PUTL(%rdi)
637 + movq ACC_PUTL(%rdi), %rax
638 + INDIRECT_JMP_REG(rax)
630 639 SET_SIZE(ddi_put32)
631 640 SET_SIZE(ddi_putl)
632 641 SET_SIZE(ddi_mem_putl)
633 642 SET_SIZE(ddi_mem_put32)
634 643 SET_SIZE(ddi_io_putl)
635 644 SET_SIZE(ddi_io_put32)
636 645
637 646 #elif defined(__i386)
638 647
639 648 ENTRY(ddi_put32)
640 649 ALTENTRY(ddi_putl)
641 650 ALTENTRY(ddi_mem_putl)
642 651 ALTENTRY(ddi_mem_put32)
643 652 ALTENTRY(ddi_io_putl)
644 653 ALTENTRY(ddi_io_put32)
645 654 movl 4(%esp), %eax
646 655 movl ACC_ATTR(%eax), %ecx
647 656 cmpl $_CONST(DDI_ACCATTR_IO_SPACE|DDI_ACCATTR_DIRECT), %ecx
648 657 jne 8f
649 658 movl 12(%esp), %eax
650 659 movl 8(%esp), %edx
651 660 outl (%dx)
652 661 ret
653 662 8:
654 663 cmpl $_CONST(DDI_ACCATTR_CPU_VADDR|DDI_ACCATTR_DIRECT), %ecx
655 664 jne 9f
656 665 movl 8(%esp), %eax
657 666 movl 12(%esp), %ecx
658 667 movl %ecx, (%eax)
659 668 ret
660 669 9:
661 670 jmp *ACC_PUTL(%eax)
662 671 SET_SIZE(ddi_put32)
663 672 SET_SIZE(ddi_putl)
664 673 SET_SIZE(ddi_mem_putl)
665 674 SET_SIZE(ddi_mem_put32)
666 675 SET_SIZE(ddi_io_putl)
↓ open down ↓ |
27 lines elided |
↑ open up ↑ |
667 676 SET_SIZE(ddi_io_put32)
668 677
669 678 #endif /* __i386 */
670 679
671 680 #if defined(__amd64)
672 681
673 682 ENTRY(ddi_put64)
674 683 ALTENTRY(ddi_putll)
675 684 ALTENTRY(ddi_mem_putll)
676 685 ALTENTRY(ddi_mem_put64)
677 - jmp *ACC_PUTLL(%rdi)
686 + movq ACC_PUTLL(%rdi), %rax
687 + INDIRECT_JMP_REG(rax)
678 688 SET_SIZE(ddi_put64)
679 689 SET_SIZE(ddi_putll)
680 690 SET_SIZE(ddi_mem_putll)
681 691 SET_SIZE(ddi_mem_put64)
682 692
683 693 #elif defined(__i386)
684 694
685 695 ENTRY(ddi_put64)
686 696 ALTENTRY(ddi_putll)
687 697 ALTENTRY(ddi_mem_putll)
688 698 ALTENTRY(ddi_mem_put64)
689 699 movl 4(%esp), %eax
690 700 jmp *ACC_PUTLL(%eax)
691 701 SET_SIZE(ddi_put64)
692 702 SET_SIZE(ddi_putll)
693 703 SET_SIZE(ddi_mem_putll)
↓ open down ↓ |
6 lines elided |
↑ open up ↑ |
694 704 SET_SIZE(ddi_mem_put64)
695 705
696 706 #endif /* __i386 */
697 707
698 708 #if defined(__amd64)
699 709
700 710 ENTRY(ddi_rep_get8)
701 711 ALTENTRY(ddi_rep_getb)
702 712 ALTENTRY(ddi_mem_rep_getb)
703 713 ALTENTRY(ddi_mem_rep_get8)
704 - jmp *ACC_REP_GETB(%rdi)
714 + movq ACC_REP_GETB(%rdi), %rax
715 + INDIRECT_JMP_REG(rax)
705 716 SET_SIZE(ddi_rep_get8)
706 717 SET_SIZE(ddi_rep_getb)
707 718 SET_SIZE(ddi_mem_rep_getb)
708 719 SET_SIZE(ddi_mem_rep_get8)
709 720
710 721 #elif defined(__i386)
711 722
712 723 ENTRY(ddi_rep_get8)
713 724 ALTENTRY(ddi_rep_getb)
714 725 ALTENTRY(ddi_mem_rep_getb)
715 726 ALTENTRY(ddi_mem_rep_get8)
716 727 movl 4(%esp), %eax
717 728 jmp *ACC_REP_GETB(%eax)
718 729 SET_SIZE(ddi_rep_get8)
719 730 SET_SIZE(ddi_rep_getb)
720 731 SET_SIZE(ddi_mem_rep_getb)
↓ open down ↓ |
6 lines elided |
↑ open up ↑ |
721 732 SET_SIZE(ddi_mem_rep_get8)
722 733
723 734 #endif /* __i386 */
724 735
725 736 #if defined(__amd64)
726 737
727 738 ENTRY(ddi_rep_get16)
728 739 ALTENTRY(ddi_rep_getw)
729 740 ALTENTRY(ddi_mem_rep_getw)
730 741 ALTENTRY(ddi_mem_rep_get16)
731 - jmp *ACC_REP_GETW(%rdi)
742 + movq ACC_REP_GETW(%rdi), %rax
743 + INDIRECT_JMP_REG(rax)
732 744 SET_SIZE(ddi_rep_get16)
733 745 SET_SIZE(ddi_rep_getw)
734 746 SET_SIZE(ddi_mem_rep_getw)
735 747 SET_SIZE(ddi_mem_rep_get16)
736 748
737 749 #elif defined(__i386)
738 750
739 751 ENTRY(ddi_rep_get16)
740 752 ALTENTRY(ddi_rep_getw)
741 753 ALTENTRY(ddi_mem_rep_getw)
742 754 ALTENTRY(ddi_mem_rep_get16)
743 755 movl 4(%esp), %eax
744 756 jmp *ACC_REP_GETW(%eax)
745 757 SET_SIZE(ddi_rep_get16)
746 758 SET_SIZE(ddi_rep_getw)
747 759 SET_SIZE(ddi_mem_rep_getw)
↓ open down ↓ |
6 lines elided |
↑ open up ↑ |
748 760 SET_SIZE(ddi_mem_rep_get16)
749 761
750 762 #endif /* __i386 */
751 763
752 764 #if defined(__amd64)
753 765
754 766 ENTRY(ddi_rep_get32)
755 767 ALTENTRY(ddi_rep_getl)
756 768 ALTENTRY(ddi_mem_rep_getl)
757 769 ALTENTRY(ddi_mem_rep_get32)
758 - jmp *ACC_REP_GETL(%rdi)
770 + movq ACC_REP_GETL(%rdi), %rax
771 + INDIRECT_JMP_REG(rax)
759 772 SET_SIZE(ddi_rep_get32)
760 773 SET_SIZE(ddi_rep_getl)
761 774 SET_SIZE(ddi_mem_rep_getl)
762 775 SET_SIZE(ddi_mem_rep_get32)
763 776
764 777 #elif defined(__i386)
765 778
766 779 ENTRY(ddi_rep_get32)
767 780 ALTENTRY(ddi_rep_getl)
768 781 ALTENTRY(ddi_mem_rep_getl)
769 782 ALTENTRY(ddi_mem_rep_get32)
770 783 movl 4(%esp), %eax
771 784 jmp *ACC_REP_GETL(%eax)
772 785 SET_SIZE(ddi_rep_get32)
773 786 SET_SIZE(ddi_rep_getl)
774 787 SET_SIZE(ddi_mem_rep_getl)
↓ open down ↓ |
6 lines elided |
↑ open up ↑ |
775 788 SET_SIZE(ddi_mem_rep_get32)
776 789
777 790 #endif /* __i386 */
778 791
779 792 #if defined(__amd64)
780 793
781 794 ENTRY(ddi_rep_get64)
782 795 ALTENTRY(ddi_rep_getll)
783 796 ALTENTRY(ddi_mem_rep_getll)
784 797 ALTENTRY(ddi_mem_rep_get64)
785 - jmp *ACC_REP_GETLL(%rdi)
798 + movq ACC_REP_GETLL(%rdi), %rax
799 + INDIRECT_JMP_REG(rax)
786 800 SET_SIZE(ddi_rep_get64)
787 801 SET_SIZE(ddi_rep_getll)
788 802 SET_SIZE(ddi_mem_rep_getll)
789 803 SET_SIZE(ddi_mem_rep_get64)
790 804
791 805 #elif defined(__i386)
792 806
793 807 ENTRY(ddi_rep_get64)
794 808 ALTENTRY(ddi_rep_getll)
795 809 ALTENTRY(ddi_mem_rep_getll)
796 810 ALTENTRY(ddi_mem_rep_get64)
797 811 movl 4(%esp), %eax
798 812 jmp *ACC_REP_GETLL(%eax)
799 813 SET_SIZE(ddi_rep_get64)
800 814 SET_SIZE(ddi_rep_getll)
801 815 SET_SIZE(ddi_mem_rep_getll)
↓ open down ↓ |
6 lines elided |
↑ open up ↑ |
802 816 SET_SIZE(ddi_mem_rep_get64)
803 817
804 818 #endif /* __i386 */
805 819
806 820 #if defined(__amd64)
807 821
808 822 ENTRY(ddi_rep_put8)
809 823 ALTENTRY(ddi_rep_putb)
810 824 ALTENTRY(ddi_mem_rep_putb)
811 825 ALTENTRY(ddi_mem_rep_put8)
812 - jmp *ACC_REP_PUTB(%rdi)
826 + movq ACC_REP_PUTB(%rdi), %rax
827 + INDIRECT_JMP_REG(rax)
813 828 SET_SIZE(ddi_rep_put8)
814 829 SET_SIZE(ddi_rep_putb)
815 830 SET_SIZE(ddi_mem_rep_putb)
816 831 SET_SIZE(ddi_mem_rep_put8)
817 832
818 833 #elif defined(__i386)
819 834
820 835 ENTRY(ddi_rep_put8)
821 836 ALTENTRY(ddi_rep_putb)
822 837 ALTENTRY(ddi_mem_rep_putb)
823 838 ALTENTRY(ddi_mem_rep_put8)
824 839 movl 4(%esp), %eax
825 840 jmp *ACC_REP_PUTB(%eax)
826 841 SET_SIZE(ddi_rep_put8)
827 842 SET_SIZE(ddi_rep_putb)
828 843 SET_SIZE(ddi_mem_rep_putb)
↓ open down ↓ |
6 lines elided |
↑ open up ↑ |
829 844 SET_SIZE(ddi_mem_rep_put8)
830 845
831 846 #endif /* __i386 */
832 847
833 848 #if defined(__amd64)
834 849
835 850 ENTRY(ddi_rep_put16)
836 851 ALTENTRY(ddi_rep_putw)
837 852 ALTENTRY(ddi_mem_rep_putw)
838 853 ALTENTRY(ddi_mem_rep_put16)
839 - jmp *ACC_REP_PUTW(%rdi)
854 + movq ACC_REP_PUTW(%rdi), %rax
855 + INDIRECT_JMP_REG(rax)
840 856 SET_SIZE(ddi_rep_put16)
841 857 SET_SIZE(ddi_rep_putw)
842 858 SET_SIZE(ddi_mem_rep_putw)
843 859 SET_SIZE(ddi_mem_rep_put16)
844 860
845 861 #elif defined(__i386)
846 862
847 863 ENTRY(ddi_rep_put16)
848 864 ALTENTRY(ddi_rep_putw)
849 865 ALTENTRY(ddi_mem_rep_putw)
850 866 ALTENTRY(ddi_mem_rep_put16)
851 867 movl 4(%esp), %eax
852 868 jmp *ACC_REP_PUTW(%eax)
853 869 SET_SIZE(ddi_rep_put16)
854 870 SET_SIZE(ddi_rep_putw)
855 871 SET_SIZE(ddi_mem_rep_putw)
↓ open down ↓ |
6 lines elided |
↑ open up ↑ |
856 872 SET_SIZE(ddi_mem_rep_put16)
857 873
858 874 #endif /* __i386 */
859 875
860 876 #if defined(__amd64)
861 877
862 878 ENTRY(ddi_rep_put32)
863 879 ALTENTRY(ddi_rep_putl)
864 880 ALTENTRY(ddi_mem_rep_putl)
865 881 ALTENTRY(ddi_mem_rep_put32)
866 - jmp *ACC_REP_PUTL(%rdi)
882 + movq ACC_REP_PUTL(%rdi), %rax
883 + INDIRECT_JMP_REG(rax)
867 884 SET_SIZE(ddi_rep_put32)
868 885 SET_SIZE(ddi_rep_putl)
869 886 SET_SIZE(ddi_mem_rep_putl)
870 887 SET_SIZE(ddi_mem_rep_put32)
871 888
872 889 #elif defined(__i386)
873 890
874 891 ENTRY(ddi_rep_put32)
875 892 ALTENTRY(ddi_rep_putl)
876 893 ALTENTRY(ddi_mem_rep_putl)
877 894 ALTENTRY(ddi_mem_rep_put32)
878 895 movl 4(%esp), %eax
879 896 jmp *ACC_REP_PUTL(%eax)
880 897 SET_SIZE(ddi_rep_put32)
881 898 SET_SIZE(ddi_rep_putl)
882 899 SET_SIZE(ddi_mem_rep_putl)
↓ open down ↓ |
6 lines elided |
↑ open up ↑ |
883 900 SET_SIZE(ddi_mem_rep_put32)
884 901
885 902 #endif /* __i386 */
886 903
887 904 #if defined(__amd64)
888 905
889 906 ENTRY(ddi_rep_put64)
890 907 ALTENTRY(ddi_rep_putll)
891 908 ALTENTRY(ddi_mem_rep_putll)
892 909 ALTENTRY(ddi_mem_rep_put64)
893 - jmp *ACC_REP_PUTLL(%rdi)
910 + movq ACC_REP_PUTLL(%rdi), %rax
911 + INDIRECT_JMP_REG(rax)
894 912 SET_SIZE(ddi_rep_put64)
895 913 SET_SIZE(ddi_rep_putll)
896 914 SET_SIZE(ddi_mem_rep_putll)
897 915 SET_SIZE(ddi_mem_rep_put64)
898 916
899 917 #elif defined(__i386)
900 918
901 919 ENTRY(ddi_rep_put64)
902 920 ALTENTRY(ddi_rep_putll)
903 921 ALTENTRY(ddi_mem_rep_putll)
904 922 ALTENTRY(ddi_mem_rep_put64)
905 923 movl 4(%esp), %eax
906 924 jmp *ACC_REP_PUTLL(%eax)
907 925 SET_SIZE(ddi_rep_put64)
908 926 SET_SIZE(ddi_rep_putll)
909 927 SET_SIZE(ddi_mem_rep_putll)
910 928 SET_SIZE(ddi_mem_rep_put64)
911 929
912 930 #endif /* __i386 */
913 931
914 932 #endif /* lint */
915 933
916 934 #if defined(lint) || defined(__lint)
917 935
918 936 /*ARGSUSED*/
919 937 uint8_t
920 938 i_ddi_vaddr_get8(ddi_acc_impl_t *hdlp, uint8_t *addr)
921 939 {
922 940 return (*addr);
923 941 }
924 942
925 943 /*ARGSUSED*/
926 944 uint16_t
927 945 i_ddi_vaddr_get16(ddi_acc_impl_t *hdlp, uint16_t *addr)
928 946 {
929 947 return (*addr);
930 948 }
931 949
932 950 /*ARGSUSED*/
933 951 uint32_t
934 952 i_ddi_vaddr_get32(ddi_acc_impl_t *hdlp, uint32_t *addr)
935 953 {
936 954 return (*addr);
937 955 }
938 956
939 957 /*ARGSUSED*/
940 958 uint64_t
941 959 i_ddi_vaddr_get64(ddi_acc_impl_t *hdlp, uint64_t *addr)
942 960 {
943 961 return (*addr);
944 962 }
945 963
946 964 #else /* lint */
947 965
948 966 #if defined(__amd64)
949 967
950 968 ENTRY(i_ddi_vaddr_get8)
951 969 movzbq (%rsi), %rax
952 970 ret
953 971 SET_SIZE(i_ddi_vaddr_get8)
954 972
955 973 #elif defined(__i386)
956 974
957 975 ENTRY(i_ddi_vaddr_get8)
958 976 movl 8(%esp), %eax
959 977 movzbl (%eax), %eax
960 978 ret
961 979 SET_SIZE(i_ddi_vaddr_get8)
962 980
963 981 #endif /* __i386 */
964 982
965 983 #if defined(__amd64)
966 984
967 985 ENTRY(i_ddi_vaddr_get16)
968 986 movzwq (%rsi), %rax
969 987 ret
970 988 SET_SIZE(i_ddi_vaddr_get16)
971 989
972 990 #elif defined(__i386)
973 991
974 992 ENTRY(i_ddi_vaddr_get16)
975 993 movl 8(%esp), %eax
976 994 movzwl (%eax), %eax
977 995 ret
978 996 SET_SIZE(i_ddi_vaddr_get16)
979 997
980 998 #endif /* __i386 */
981 999
982 1000 #if defined(__amd64)
983 1001
984 1002 ENTRY(i_ddi_vaddr_get32)
985 1003 movl (%rsi), %eax
986 1004 ret
987 1005 SET_SIZE(i_ddi_vaddr_get32)
988 1006
989 1007 #elif defined(__i386)
990 1008
991 1009 ENTRY(i_ddi_vaddr_get32)
992 1010 movl 8(%esp), %eax
993 1011 movl (%eax), %eax
994 1012 ret
995 1013 SET_SIZE(i_ddi_vaddr_get32)
996 1014
997 1015 #endif /* __i386 */
998 1016
999 1017 #if defined(__amd64)
1000 1018
1001 1019 ENTRY(i_ddi_vaddr_get64)
1002 1020 movq (%rsi), %rax
1003 1021 ret
1004 1022 SET_SIZE(i_ddi_vaddr_get64)
1005 1023
1006 1024 #elif defined(__i386)
1007 1025
1008 1026 ENTRY(i_ddi_vaddr_get64)
1009 1027 movl 8(%esp), %ecx
1010 1028 movl (%ecx), %eax
1011 1029 movl 4(%ecx), %edx
1012 1030 ret
1013 1031 SET_SIZE(i_ddi_vaddr_get64)
1014 1032
1015 1033 #endif /* __i386 */
1016 1034
1017 1035 #endif /* lint */
1018 1036
1019 1037
1020 1038 #if defined(lint) || defined(__lint)
1021 1039
1022 1040 /*ARGSUSED*/
1023 1041 uint8_t
1024 1042 i_ddi_io_get8(ddi_acc_impl_t *hdlp, uint8_t *addr)
1025 1043 {
1026 1044 return (0);
1027 1045 }
1028 1046
1029 1047 /*ARGSUSED*/
1030 1048 uint16_t
1031 1049 i_ddi_io_get16(ddi_acc_impl_t *hdlp, uint16_t *addr)
1032 1050 {
1033 1051 return (0);
1034 1052 }
1035 1053
1036 1054 /*ARGSUSED*/
1037 1055 uint32_t
1038 1056 i_ddi_io_get32(ddi_acc_impl_t *hdlp, uint32_t *addr)
1039 1057 {
1040 1058 return (0);
1041 1059 }
1042 1060
1043 1061 #else /* lint */
1044 1062
1045 1063 #if defined(__amd64)
1046 1064
1047 1065 ENTRY(i_ddi_io_get8)
1048 1066 movq %rsi, %rdx
1049 1067 inb (%dx)
1050 1068 movzbq %al, %rax
1051 1069 ret
1052 1070 SET_SIZE(i_ddi_io_get8)
1053 1071
1054 1072 #elif defined(__i386)
1055 1073
1056 1074 ENTRY(i_ddi_io_get8)
1057 1075 movl 8(%esp), %edx
1058 1076 inb (%dx)
1059 1077 movzbl %al, %eax
1060 1078 ret
1061 1079 SET_SIZE(i_ddi_io_get8)
1062 1080
1063 1081 #endif /* __i386 */
1064 1082
1065 1083 #if defined(__amd64)
1066 1084
1067 1085 ENTRY(i_ddi_io_get16)
1068 1086 movq %rsi, %rdx
1069 1087 inw (%dx)
1070 1088 movzwq %ax, %rax
1071 1089 ret
1072 1090 SET_SIZE(i_ddi_io_get16)
1073 1091
1074 1092 #elif defined(__i386)
1075 1093
1076 1094 ENTRY(i_ddi_io_get16)
1077 1095 movl 8(%esp), %edx
1078 1096 inw (%dx)
1079 1097 movzwl %ax, %eax
1080 1098 ret
1081 1099 SET_SIZE(i_ddi_io_get16)
1082 1100
1083 1101 #endif /* __i386 */
1084 1102
1085 1103 #if defined(__amd64)
1086 1104
1087 1105 ENTRY(i_ddi_io_get32)
1088 1106 movq %rsi, %rdx
1089 1107 inl (%dx)
1090 1108 ret
1091 1109 SET_SIZE(i_ddi_io_get32)
1092 1110
1093 1111 #elif defined(__i386)
1094 1112
1095 1113 ENTRY(i_ddi_io_get32)
1096 1114 movl 8(%esp), %edx
1097 1115 inl (%dx)
1098 1116 ret
1099 1117 SET_SIZE(i_ddi_io_get32)
1100 1118
1101 1119 #endif /* __i386 */
1102 1120
1103 1121 #endif /* lint */
1104 1122
1105 1123 #if defined(lint) || defined(__lint)
1106 1124
1107 1125 /*ARGSUSED*/
1108 1126 void
1109 1127 i_ddi_vaddr_put8(ddi_acc_impl_t *hdlp, uint8_t *addr, uint8_t value)
1110 1128 {
1111 1129 *addr = value;
1112 1130 }
1113 1131
1114 1132 /*ARGSUSED*/
1115 1133 void
1116 1134 i_ddi_vaddr_put16(ddi_acc_impl_t *hdlp, uint16_t *addr, uint16_t value)
1117 1135 {
1118 1136 *addr = value;
1119 1137 }
1120 1138
1121 1139 /*ARGSUSED*/
1122 1140 void
1123 1141 i_ddi_vaddr_put32(ddi_acc_impl_t *hdlp, uint32_t *addr, uint32_t value)
1124 1142 {
1125 1143 *(uint32_t *)addr = value;
1126 1144 }
1127 1145
1128 1146 /*ARGSUSED*/
1129 1147 void
1130 1148 i_ddi_vaddr_put64(ddi_acc_impl_t *hdlp, uint64_t *addr, uint64_t value)
1131 1149 {
1132 1150 *addr = value;
1133 1151 }
1134 1152
1135 1153 #else /* lint */
1136 1154
1137 1155 #if defined(__amd64)
1138 1156
1139 1157 ENTRY(i_ddi_vaddr_put8)
1140 1158 movb %dl, (%rsi)
1141 1159 ret
1142 1160 SET_SIZE(i_ddi_vaddr_put8)
1143 1161
1144 1162 #elif defined(__i386)
1145 1163
1146 1164 ENTRY(i_ddi_vaddr_put8)
1147 1165 movl 8(%esp), %eax
1148 1166 movb 12(%esp), %cl
1149 1167 movb %cl, (%eax)
1150 1168 ret
1151 1169 SET_SIZE(i_ddi_vaddr_put8)
1152 1170
1153 1171 #endif /* __i386 */
1154 1172
1155 1173 #if defined(__amd64)
1156 1174
1157 1175 ENTRY(i_ddi_vaddr_put16)
1158 1176 movw %dx, (%rsi)
1159 1177 ret
1160 1178 SET_SIZE(i_ddi_vaddr_put16)
1161 1179
1162 1180 #elif defined(__i386)
1163 1181
1164 1182 ENTRY(i_ddi_vaddr_put16)
1165 1183 movl 8(%esp), %eax
1166 1184 movl 12(%esp), %ecx
1167 1185 movw %cx, (%eax)
1168 1186 ret
1169 1187 SET_SIZE(i_ddi_vaddr_put16)
1170 1188
1171 1189 #endif /* __i386 */
1172 1190
1173 1191 #if defined(__amd64)
1174 1192
1175 1193 ENTRY(i_ddi_vaddr_put32)
1176 1194 movl %edx, (%rsi)
1177 1195 ret
1178 1196 SET_SIZE(i_ddi_vaddr_put32)
1179 1197
1180 1198 #elif defined(__i386)
1181 1199
1182 1200 ENTRY(i_ddi_vaddr_put32)
1183 1201 movl 8(%esp), %eax
1184 1202 movl 12(%esp), %ecx
1185 1203 movl %ecx, (%eax)
1186 1204 ret
1187 1205 SET_SIZE(i_ddi_vaddr_put32)
1188 1206
1189 1207 #endif /* __i386 */
1190 1208
1191 1209 #if defined(__amd64)
1192 1210
1193 1211 ENTRY(i_ddi_vaddr_put64)
1194 1212 movq %rdx, (%rsi)
1195 1213 ret
1196 1214 SET_SIZE(i_ddi_vaddr_put64)
1197 1215
1198 1216 #elif defined(__i386)
1199 1217
1200 1218 ENTRY(i_ddi_vaddr_put64)
1201 1219 movl 8(%esp), %ecx
1202 1220 movl 12(%esp), %edx
1203 1221 movl 16(%esp), %eax
1204 1222 movl %edx, (%ecx)
1205 1223 movl %eax, 4(%ecx)
1206 1224 ret
1207 1225 SET_SIZE(i_ddi_vaddr_put64)
1208 1226
1209 1227 #endif /* __i386 */
1210 1228
1211 1229 #endif /* lint */
1212 1230
1213 1231 #if defined(lint) || defined(__lint)
1214 1232
1215 1233 /*ARGSUSED*/
1216 1234 void
1217 1235 i_ddi_io_put8(ddi_acc_impl_t *hdlp, uint8_t *addr, uint8_t value)
1218 1236 {}
1219 1237
1220 1238 /*ARGSUSED*/
1221 1239 void
1222 1240 i_ddi_io_put16(ddi_acc_impl_t *hdlp, uint16_t *addr, uint16_t value)
1223 1241 {}
1224 1242
1225 1243 /*ARGSUSED*/
1226 1244 void
1227 1245 i_ddi_io_put32(ddi_acc_impl_t *hdlp, uint32_t *addr, uint32_t value)
1228 1246 {}
1229 1247
1230 1248 #else /* lint */
1231 1249
1232 1250 #if defined(__amd64)
1233 1251
1234 1252 ENTRY(i_ddi_io_put8)
1235 1253 movq %rdx, %rax
1236 1254 movq %rsi, %rdx
1237 1255 outb (%dx)
1238 1256 ret
1239 1257 SET_SIZE(i_ddi_io_put8)
1240 1258
1241 1259 #elif defined(__i386)
1242 1260
1243 1261 ENTRY(i_ddi_io_put8)
1244 1262 movl 12(%esp), %eax
1245 1263 movl 8(%esp), %edx
1246 1264 outb (%dx)
1247 1265 ret
1248 1266 SET_SIZE(i_ddi_io_put8)
1249 1267
1250 1268 #endif /* __i386 */
1251 1269
1252 1270 #if defined(__amd64)
1253 1271
1254 1272 ENTRY(i_ddi_io_put16)
1255 1273 movq %rdx, %rax
1256 1274 movq %rsi, %rdx
1257 1275 outw (%dx)
1258 1276 ret
1259 1277 SET_SIZE(i_ddi_io_put16)
1260 1278
1261 1279 #elif defined(__i386)
1262 1280
1263 1281 ENTRY(i_ddi_io_put16)
1264 1282 movl 12(%esp), %eax
1265 1283 movl 8(%esp), %edx
1266 1284 outw (%dx)
1267 1285 ret
1268 1286 SET_SIZE(i_ddi_io_put16)
1269 1287
1270 1288 #endif /* __i386 */
1271 1289
1272 1290 #if defined(__amd64)
1273 1291
1274 1292 ENTRY(i_ddi_io_put32)
1275 1293 movq %rdx, %rax
1276 1294 movq %rsi, %rdx
1277 1295 outl (%dx)
1278 1296 ret
1279 1297 SET_SIZE(i_ddi_io_put32)
1280 1298
1281 1299 #elif defined(__i386)
1282 1300
1283 1301 ENTRY(i_ddi_io_put32)
1284 1302 movl 12(%esp), %eax
1285 1303 movl 8(%esp), %edx
1286 1304 outl (%dx)
1287 1305 ret
1288 1306 SET_SIZE(i_ddi_io_put32)
1289 1307
1290 1308 #endif /* __i386 */
1291 1309
1292 1310 #endif /* lint */
1293 1311
1294 1312 #if defined(lint) || defined(__lint)
1295 1313
1296 1314 /*ARGSUSED*/
1297 1315 void
1298 1316 i_ddi_io_rep_get8(ddi_acc_impl_t *hdlp, uint8_t *host_addr,
1299 1317 uint8_t *dev_addr, size_t repcount, uint_t flags)
1300 1318 {}
1301 1319
1302 1320 /*ARGSUSED*/
1303 1321 void
1304 1322 i_ddi_io_rep_get16(ddi_acc_impl_t *hdlp, uint16_t *host_addr,
1305 1323 uint16_t *dev_addr, size_t repcount, uint_t flags)
1306 1324 {}
1307 1325
1308 1326 /*ARGSUSED*/
1309 1327 void
1310 1328 i_ddi_io_rep_get32(ddi_acc_impl_t *hdlp, uint32_t *host_addr,
1311 1329 uint32_t *dev_addr, size_t repcount, uint_t flags)
1312 1330 {}
1313 1331
1314 1332 #else /* lint */
1315 1333
1316 1334 #if defined(__amd64)
1317 1335
1318 1336 /*
1319 1337 * Incoming arguments
1320 1338 *
1321 1339 * %rdi : hdlp
1322 1340 * %rsi : host_addr
1323 1341 * %rdx : dev_addr
1324 1342 * %rcx : repcount
1325 1343 * %r8 : flags
1326 1344 *
1327 1345 * This routine will destroy values in %rdx, %rsi, %rcx.
1328 1346 */
↓ open down ↓ |
425 lines elided |
↑ open up ↑ |
1329 1347 ENTRY(i_ddi_io_rep_get8)
1330 1348
1331 1349 cmpq $DDI_DEV_AUTOINCR, %r8
1332 1350 je gb_ioadv
1333 1351 movq %rsi, %rdi
1334 1352 rep
1335 1353 insb
1336 1354 ret
1337 1355
1338 1356 gb_ioadv:
1339 - andq %rcx, %rcx
1357 + andq %rcx, %rcx
1340 1358 jz gb_ioadv_done
1341 1359 gb_ioadv2:
1342 1360 inb (%dx)
1343 1361 movb %al, (%rsi)
1344 1362 incq %rdx
1345 1363 incq %rsi
1346 1364 decq %rcx
1347 1365 jg gb_ioadv2
1348 1366
1349 1367 gb_ioadv_done:
1350 1368 rep; ret /* use 2 byte return instruction when branch target */
1351 1369 /* AMD Software Optimization Guide - Section 6.2 */
1352 1370
1353 1371 SET_SIZE(i_ddi_io_rep_get8)
1354 1372
1355 1373 #elif defined(__i386)
↓ open down ↓ |
6 lines elided |
↑ open up ↑ |
1356 1374
1357 1375 ENTRY(i_ddi_io_rep_get8)
1358 1376 pushl %edi
1359 1377
1360 1378 movl 12(%esp),%edi / get host_addr
1361 1379 movl 16(%esp),%edx / get port
1362 1380 movl 20(%esp),%ecx / get repcount
1363 1381 cmpl $DDI_DEV_AUTOINCR, 24(%esp)
1364 1382 je gb_ioadv
1365 1383
1366 - rep
1384 + rep
1367 1385 insb
1368 1386 popl %edi
1369 1387 ret
1370 1388
1371 1389 gb_ioadv:
1372 1390 andl %ecx, %ecx
1373 1391 jz gb_ioadv_done
1374 1392 gb_ioadv2:
1375 1393 inb (%dx)
1376 1394 movb %al,(%edi)
1377 1395 incl %edi
1378 1396 incl %edx
1379 1397 decl %ecx
1380 1398 jg gb_ioadv2
1381 1399
1382 1400 gb_ioadv_done:
1383 1401 popl %edi
1384 1402 ret
1385 1403
1386 1404 SET_SIZE(i_ddi_io_rep_get8)
1387 1405
↓ open down ↓ |
11 lines elided |
↑ open up ↑ |
1388 1406 #endif /* __i386 */
1389 1407
1390 1408 #if defined(__amd64)
1391 1409
1392 1410 ENTRY(i_ddi_io_rep_get16)
1393 1411
1394 1412 cmpq $DDI_DEV_AUTOINCR, %r8
1395 1413 je gw_ioadv
1396 1414
1397 1415 movq %rsi, %rdi
1398 - rep
1416 + rep
1399 1417 insw
1400 1418 ret
1401 1419
1402 1420 gw_ioadv:
1403 1421 andq %rcx, %rcx
1404 1422 jz gw_ioadv_done
1405 1423 gw_ioadv2:
1406 1424 inw (%dx)
1407 1425 movw %ax,(%rsi)
1408 1426 addq $2, %rsi
1409 1427 addq $2, %rdx
1410 1428 decq %rcx
1411 1429 jg gw_ioadv2
1412 1430
1413 1431 gw_ioadv_done:
1414 1432 rep; ret /* use 2 byte return instruction when branch target */
1415 1433 /* AMD Software Optimization Guide - Section 6.2 */
1416 1434 SET_SIZE(i_ddi_io_rep_get16)
1417 1435
1418 1436 #elif defined(__i386)
↓ open down ↓ |
10 lines elided |
↑ open up ↑ |
1419 1437
1420 1438 ENTRY(i_ddi_io_rep_get16)
1421 1439 pushl %edi
1422 1440
1423 1441 movl 12(%esp),%edi / get host_addr
1424 1442 movl 16(%esp),%edx / get port
1425 1443 movl 20(%esp),%ecx / get repcount
1426 1444 cmpl $DDI_DEV_AUTOINCR, 24(%esp)
1427 1445 je gw_ioadv
1428 1446
1429 - rep
1447 + rep
1430 1448 insw
1431 1449 popl %edi
1432 1450 ret
1433 1451
1434 1452 gw_ioadv:
1435 1453 andl %ecx, %ecx
1436 1454 jz gw_ioadv_done
1437 1455 gw_ioadv2:
1438 1456 inw (%dx)
1439 1457 movw %ax,(%edi)
1440 1458 addl $2, %edi
1441 1459 addl $2, %edx
1442 1460 decl %ecx
1443 1461 jg gw_ioadv2
1444 1462
1445 1463 gw_ioadv_done:
1446 1464 popl %edi
1447 1465 ret
1448 1466 SET_SIZE(i_ddi_io_rep_get16)
1449 1467
↓ open down ↓ |
10 lines elided |
↑ open up ↑ |
1450 1468 #endif /* __i386 */
1451 1469
1452 1470 #if defined(__amd64)
1453 1471
1454 1472 ENTRY(i_ddi_io_rep_get32)
1455 1473
1456 1474 cmpq $DDI_DEV_AUTOINCR, %r8
1457 1475 je gl_ioadv
1458 1476
1459 1477 movq %rsi, %rdi
1460 - rep
1478 + rep
1461 1479 insl
1462 1480 ret
1463 1481
1464 1482 gl_ioadv:
1465 1483 andq %rcx, %rcx
1466 1484 jz gl_ioadv_done
1467 1485 gl_ioadv2:
1468 1486 inl (%dx)
1469 1487 movl %eax,(%rsi)
1470 1488 addq $4, %rsi
1471 1489 addq $4, %rdx
1472 1490 decq %rcx
1473 1491 jg gl_ioadv2
1474 1492
1475 1493 gl_ioadv_done:
1476 1494 rep; ret /* use 2 byte return instruction when branch target */
1477 1495 /* AMD Software Optimization Guide - Section 6.2 */
1478 1496
1479 1497 SET_SIZE(i_ddi_io_rep_get32)
1480 1498
1481 1499
1482 1500 #elif defined(__i386)
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
1483 1501
1484 1502 ENTRY(i_ddi_io_rep_get32)
1485 1503 pushl %edi
1486 1504
1487 1505 movl 12(%esp),%edi / get host_addr
1488 1506 movl 16(%esp),%edx / get port
1489 1507 movl 20(%esp),%ecx / get repcount
1490 1508 cmpl $DDI_DEV_AUTOINCR, 24(%esp)
1491 1509 je gl_ioadv
1492 1510
1493 - rep
1511 + rep
1494 1512 insl
1495 1513 popl %edi
1496 1514 ret
1497 1515
1498 1516 gl_ioadv:
1499 1517 andl %ecx, %ecx
1500 1518 jz gl_ioadv_done
1501 1519 gl_ioadv2:
1502 1520 inl (%dx)
1503 1521 movl %eax,(%edi)
1504 1522 addl $4, %edi
1505 1523 addl $4, %edx
1506 1524 decl %ecx
1507 1525 jg gl_ioadv2
1508 1526
1509 1527 gl_ioadv_done:
1510 1528 popl %edi
1511 1529 ret
1512 1530
1513 1531 SET_SIZE(i_ddi_io_rep_get32)
1514 1532
1515 1533 #endif /* __i386 */
1516 1534
1517 1535 #endif /* lint */
1518 1536
1519 1537 #if defined(lint) || defined(__lint)
1520 1538
1521 1539 /*ARGSUSED*/
1522 1540 void
1523 1541 i_ddi_io_rep_put8(ddi_acc_impl_t *hdlp, uint8_t *host_addr,
1524 1542 uint8_t *dev_addr, size_t repcount, uint_t flags)
1525 1543 {}
1526 1544
1527 1545 /*ARGSUSED*/
1528 1546 void
1529 1547 i_ddi_io_rep_put16(ddi_acc_impl_t *hdlp, uint16_t *host_addr,
1530 1548 uint16_t *dev_addr, size_t repcount, uint_t flags)
1531 1549 {}
1532 1550
1533 1551 /*ARGSUSED*/
1534 1552 void
1535 1553 i_ddi_io_rep_put32(ddi_acc_impl_t *hdlp, uint32_t *host_addr,
1536 1554 uint32_t *dev_addr, size_t repcount, uint_t flags)
1537 1555 {}
1538 1556
1539 1557 #else /* lint */
1540 1558
1541 1559 #if defined(__amd64)
1542 1560
1543 1561 /*
1544 1562 * Incoming arguments
1545 1563 *
1546 1564 * %rdi : hdlp
1547 1565 * %rsi : host_addr
1548 1566 * %rdx : dev_addr
1549 1567 * %rcx : repcount
↓ open down ↓ |
46 lines elided |
↑ open up ↑ |
1550 1568 * %r8 : flags
1551 1569 *
1552 1570 * This routine will destroy values in %rdx, %rsi, %rcx.
1553 1571 */
1554 1572 ENTRY(i_ddi_io_rep_put8)
1555 1573
1556 1574 cmpq $DDI_DEV_AUTOINCR, %r8
1557 1575 je pb_ioadv
1558 1576
1559 1577 movq %rsi, %rdi
1560 - rep
1578 + rep
1561 1579 outsb
1562 1580 ret
1563 1581
1564 1582 pb_ioadv:
1565 1583 andq %rcx, %rcx
1566 1584 jz pb_ioadv_done
1567 1585 pb_ioadv2:
1568 1586 movb (%rsi), %al
1569 1587 outb (%dx)
1570 1588 incq %rsi
1571 1589 incq %rdx
1572 1590 decq %rcx
1573 1591 jg pb_ioadv2
1574 1592
1575 1593 pb_ioadv_done:
1576 1594 rep; ret /* use 2 byte return instruction when branch target */
1577 1595 /* AMD Software Optimization Guide - Section 6.2 */
1578 1596 SET_SIZE(i_ddi_io_rep_put8)
1579 1597
1580 1598 #elif defined(__i386)
↓ open down ↓ |
10 lines elided |
↑ open up ↑ |
1581 1599
1582 1600 ENTRY(i_ddi_io_rep_put8)
1583 1601 pushl %esi
1584 1602
1585 1603 movl 12(%esp),%esi / get host_addr
1586 1604 movl 16(%esp),%edx / get port
1587 1605 movl 20(%esp),%ecx / get repcount
1588 1606 cmpl $DDI_DEV_AUTOINCR, 24(%esp)
1589 1607 je pb_ioadv
1590 1608
1591 - rep
1609 + rep
1592 1610 outsb
1593 1611 popl %esi
1594 1612 ret
1595 1613
1596 1614 pb_ioadv:
1597 1615 andl %ecx, %ecx
1598 1616 jz pb_ioadv_done
1599 1617 pb_ioadv2:
1600 1618 movb (%esi), %al
1601 1619 outb (%dx)
1602 1620 incl %esi
1603 1621 incl %edx
1604 1622 decl %ecx
1605 1623 jg pb_ioadv2
1606 1624
1607 1625 pb_ioadv_done:
1608 1626 popl %esi
1609 1627 ret
1610 1628 SET_SIZE(i_ddi_io_rep_put8)
1611 1629
↓ open down ↓ |
10 lines elided |
↑ open up ↑ |
1612 1630 #endif /* __i386 */
1613 1631
1614 1632 #if defined(__amd64)
1615 1633
1616 1634 ENTRY(i_ddi_io_rep_put16)
1617 1635
1618 1636 cmpq $DDI_DEV_AUTOINCR, %r8
1619 1637 je pw_ioadv
1620 1638
1621 1639 movq %rsi, %rdi
1622 - rep
1640 + rep
1623 1641 outsw
1624 1642 ret
1625 1643
1626 1644 pw_ioadv:
1627 1645 andq %rcx, %rcx
1628 1646 jz pw_ioadv_done
1629 1647 pw_ioadv2:
1630 1648 movw (%rsi), %ax
1631 1649 outw (%dx)
1632 1650 addq $2, %rsi
1633 1651 addq $2, %rdx
1634 1652 decq %rcx
1635 1653 jg pw_ioadv2
1636 1654
1637 1655 pw_ioadv_done:
1638 1656 rep; ret /* use 2 byte return instruction when branch target */
1639 1657 /* AMD Software Optimization Guide - Section 6.2 */
1640 1658 SET_SIZE(i_ddi_io_rep_put16)
1641 1659
1642 1660 #elif defined(__i386)
↓ open down ↓ |
10 lines elided |
↑ open up ↑ |
1643 1661
1644 1662 ENTRY(i_ddi_io_rep_put16)
1645 1663 pushl %esi
1646 1664
1647 1665 movl 12(%esp),%esi / get host_addr
1648 1666 movl 16(%esp),%edx / get port
1649 1667 movl 20(%esp),%ecx / get repcount
1650 1668 cmpl $DDI_DEV_AUTOINCR, 24(%esp)
1651 1669 je pw_ioadv
1652 1670
1653 - rep
1671 + rep
1654 1672 outsw
1655 1673 popl %esi
1656 1674 ret
1657 1675
1658 1676 pw_ioadv:
1659 1677 andl %ecx, %ecx
1660 1678 jz pw_ioadv_done
1661 1679 pw_ioadv2:
1662 1680 movw (%esi), %ax
1663 1681 outw (%dx)
1664 1682 addl $2, %esi
1665 1683 addl $2, %edx
1666 1684 decl %ecx
1667 1685 jg pw_ioadv2
1668 1686
1669 1687 pw_ioadv_done:
1670 1688 popl %esi
1671 1689 ret
1672 1690 SET_SIZE(i_ddi_io_rep_put16)
1673 1691
↓ open down ↓ |
10 lines elided |
↑ open up ↑ |
1674 1692 #endif /* __i386 */
1675 1693
1676 1694 #if defined(__amd64)
1677 1695
1678 1696 ENTRY(i_ddi_io_rep_put32)
1679 1697
1680 1698 cmpq $DDI_DEV_AUTOINCR, %r8
1681 1699 je pl_ioadv
1682 1700
1683 1701 movq %rsi, %rdi
1684 - rep
1702 + rep
1685 1703 outsl
1686 1704 ret
1687 1705
1688 1706 pl_ioadv:
1689 1707 andq %rcx, %rcx
1690 1708 jz pl_ioadv_done
1691 1709 pl_ioadv2:
1692 1710 movl (%rsi), %eax
1693 1711 outl (%dx)
1694 1712 addq $4, %rsi
1695 1713 addq $4, %rdx
1696 1714 decq %rcx
1697 1715 jg pl_ioadv2
1698 1716
1699 1717 pl_ioadv_done:
1700 1718 rep; ret /* use 2 byte return instruction when branch target */
1701 1719 /* AMD Software Optimization Guide - Section 6.2 */
1702 1720 SET_SIZE(i_ddi_io_rep_put32)
1703 1721
1704 1722 #elif defined(__i386)
↓ open down ↓ |
10 lines elided |
↑ open up ↑ |
1705 1723
1706 1724 ENTRY(i_ddi_io_rep_put32)
1707 1725 pushl %esi
1708 1726
1709 1727 movl 12(%esp),%esi / get host_addr
1710 1728 movl 16(%esp),%edx / get port
1711 1729 movl 20(%esp),%ecx / get repcount
1712 1730 cmpl $DDI_DEV_AUTOINCR, 24(%esp)
1713 1731 je pl_ioadv
1714 1732
1715 - rep
1733 + rep
1716 1734 outsl
1717 1735 popl %esi
1718 1736 ret
1719 1737
1720 1738 pl_ioadv:
1721 1739 andl %ecx, %ecx
1722 1740 jz pl_ioadv_done
1723 1741 pl_ioadv2:
1724 1742 movl (%esi), %eax
1725 1743 outl (%dx)
1726 1744 addl $4, %esi
1727 1745 addl $4, %edx
1728 1746 decl %ecx
1729 1747 jg pl_ioadv2
1730 1748
1731 1749 pl_ioadv_done:
1732 1750 popl %esi
1733 1751 ret
1734 1752 SET_SIZE(i_ddi_io_rep_put32)
1735 1753
1736 1754 #endif /* __i386 */
1737 1755
1738 1756 #endif /* lint */
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX