Print this page
de-linting of .s files
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/sparc/dtrace/dtrace_asm.s
+++ new/usr/src/uts/sparc/dtrace/dtrace_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 -#if defined(lint) || defined(__lint)
29 -#include <sys/dtrace_impl.h>
30 -#else
31 26 #include <sys/asm_linkage.h>
32 27 #include <sys/privregs.h>
33 28 #include <sys/fsr.h>
34 29 #include <sys/asi.h>
35 30 #include "assym.h"
36 -#endif
37 31
38 -#if defined(lint) || defined(__lint)
39 -
40 -int
41 -dtrace_getipl(void)
42 -{ return (0); }
43 -
44 -#else /* lint */
45 -
46 32 ENTRY_NP(dtrace_getipl)
47 33 retl
48 34 rdpr %pil, %o0
49 35 SET_SIZE(dtrace_getipl)
50 36
51 -#endif /* lint */
52 -
53 -#if defined(lint) || defined(__lint)
54 -
55 -uint_t
56 -dtrace_getotherwin(void)
57 -{ return (0); }
58 -
59 -#else /* lint */
60 -
61 37 ENTRY_NP(dtrace_getotherwin)
62 38 retl
63 39 rdpr %otherwin, %o0
64 40 SET_SIZE(dtrace_getotherwin)
65 41
66 -#endif /* lint */
67 -
68 -#if defined(lint) || defined(__lint)
69 -
70 -uint_t
71 -dtrace_getfprs(void)
72 -{ return (0); }
73 -
74 -#else /* lint */
75 -
76 42 ENTRY_NP(dtrace_getfprs)
77 43 retl
78 44 rd %fprs, %o0
79 45 SET_SIZE(dtrace_getfprs)
80 46
81 -#endif /* lint */
82 -
83 -#if defined(lint) || defined(__lint)
84 -
85 -/*ARGSUSED*/
86 -void
87 -dtrace_getfsr(uint64_t *val)
88 -{}
89 -
90 -#else /* lint */
91 -
92 47 ENTRY_NP(dtrace_getfsr)
93 48 rdpr %pstate, %o1
94 49 andcc %o1, PSTATE_PEF, %g0
95 50 bz,pn %xcc, 1f
96 51 nop
97 52 rd %fprs, %o1
98 53 andcc %o1, FPRS_FEF, %g0
99 54 bz,pn %xcc, 1f
100 55 nop
101 56 retl
102 57 stx %fsr, [%o0]
103 58 1:
104 59 retl
105 60 stx %g0, [%o0]
106 61 SET_SIZE(dtrace_getfsr)
107 62
108 -#endif /* lint */
109 -
110 -#if defined(lint) || defined(__lint)
111 -
112 -greg_t
113 -dtrace_getfp(void)
114 -{ return (0); }
115 -
116 -#else /* lint */
117 -
118 63 ENTRY_NP(dtrace_getfp)
119 64 retl
120 65 mov %fp, %o0
121 66 SET_SIZE(dtrace_getfp)
122 67
123 -#endif /* lint */
124 -
125 -#if defined(lint) || defined(__lint)
126 -
127 -void
128 -dtrace_flush_user_windows(void)
129 -{}
130 -
131 -#else
132 -
133 68 ENTRY_NP(dtrace_flush_user_windows)
134 69 rdpr %otherwin, %g1
135 70 brz %g1, 3f
136 71 clr %g2
137 72 1:
138 73 save %sp, -WINDOWSIZE, %sp
139 74 rdpr %otherwin, %g1
140 75 brnz %g1, 1b
141 76 add %g2, 1, %g2
142 77 2:
143 78 sub %g2, 1, %g2 ! restore back to orig window
144 79 brnz %g2, 2b
145 80 restore
146 81 3:
147 82 retl
148 83 nop
149 84 SET_SIZE(dtrace_flush_user_windows)
150 85
151 -#endif /* lint */
152 -
153 -#if defined(lint) || defined(__lint)
154 -
155 -uint32_t
156 -dtrace_cas32(uint32_t *target, uint32_t cmp, uint32_t new)
157 -{
158 - uint32_t old;
159 -
160 - if ((old = *target) == cmp)
161 - *target = new;
162 - return (old);
163 -}
164 -
165 -void *
166 -dtrace_casptr(void *target, void *cmp, void *new)
167 -{
168 - void *old;
169 -
170 - if ((old = *(void **)target) == cmp)
171 - *(void **)target = new;
172 - return (old);
173 -}
174 -
175 -#else /* lint */
176 -
177 86 ENTRY(dtrace_cas32)
178 87 cas [%o0], %o1, %o2
179 88 retl
180 89 mov %o2, %o0
181 90 SET_SIZE(dtrace_cas32)
182 91
183 92 ENTRY(dtrace_casptr)
184 93 casn [%o0], %o1, %o2
185 94 retl
186 95 mov %o2, %o0
187 96 SET_SIZE(dtrace_casptr)
188 97
189 -#endif /* lint */
190 -
191 -#if defined(lint)
192 -
193 -/*ARGSUSED*/
194 -uintptr_t
195 -dtrace_caller(int aframes)
196 -{
197 - return (0);
198 -}
199 -
200 -#else /* lint */
201 -
202 98 ENTRY(dtrace_caller)
203 99 sethi %hi(nwin_minus_one), %g4
204 100 ld [%g4 + %lo(nwin_minus_one)], %g4
205 101 rdpr %canrestore, %g2
206 102 cmp %g2, %o0
207 103 bl %icc, 1f
208 104 rdpr %cwp, %g1
209 105 sub %g1, %o0, %g3
210 106 brgez,a,pt %g3, 0f
211 107 wrpr %g3, %cwp
212 108
213 109 !
214 110 ! CWP minus the number of frames is negative; we must perform the
215 111 ! arithmetic modulo MAXWIN.
216 112 !
217 113 add %g4, %g3, %g3
218 114 inc %g3
219 115 wrpr %g3, %cwp
220 116 0:
221 117 mov %i7, %g4
222 118 wrpr %g1, %cwp
223 119 retl
224 120 mov %g4, %o0
225 121 1:
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
226 122 !
227 123 ! The caller has been flushed to the stack. This is unlikely
228 124 ! (interrupts are disabled in dtrace_probe()), but possible (the
229 125 ! interrupt inducing the spill may have been taken before the
230 126 ! call to dtrace_probe()).
231 127 !
232 128 retl
233 129 mov -1, %o0
234 130 SET_SIZE(dtrace_caller)
235 131
236 -#endif
237 -
238 -#if defined(lint)
239 -
240 -/*ARGSUSED*/
241 -int
242 -dtrace_fish(int aframes, int reg, uintptr_t *regval)
243 -{
244 - return (0);
245 -}
246 -
247 -#else /* lint */
248 -
249 132 ENTRY(dtrace_fish)
250 133
251 134 rd %pc, %g5
252 135 ba 0f
253 136 add %g5, 12, %g5
254 137 mov %l0, %g4
255 138 mov %l1, %g4
256 139 mov %l2, %g4
257 140 mov %l3, %g4
258 141 mov %l4, %g4
259 142 mov %l5, %g4
260 143 mov %l6, %g4
261 144 mov %l7, %g4
262 145 mov %i0, %g4
263 146 mov %i1, %g4
264 147 mov %i2, %g4
265 148 mov %i3, %g4
266 149 mov %i4, %g4
267 150 mov %i5, %g4
268 151 mov %i6, %g4
269 152 mov %i7, %g4
270 153 0:
271 154 sub %o1, 16, %o1 ! Can only retrieve %l's and %i's
272 155 sll %o1, 2, %o1 ! Multiply by instruction size
273 156 add %g5, %o1, %g5 ! %g5 now contains the instr. to pick
274 157
275 158 sethi %hi(nwin_minus_one), %g4
276 159 ld [%g4 + %lo(nwin_minus_one)], %g4
277 160
278 161 !
279 162 ! First we need to see if the frame that we're fishing in is still
280 163 ! contained in the register windows.
281 164 !
282 165 rdpr %canrestore, %g2
283 166 cmp %g2, %o0
284 167 bl %icc, 2f
285 168 rdpr %cwp, %g1
286 169 sub %g1, %o0, %g3
287 170 brgez,a,pt %g3, 0f
288 171 wrpr %g3, %cwp
289 172
290 173 !
291 174 ! CWP minus the number of frames is negative; we must perform the
292 175 ! arithmetic modulo MAXWIN.
293 176 !
294 177 add %g4, %g3, %g3
295 178 inc %g3
296 179 wrpr %g3, %cwp
297 180 0:
298 181 jmp %g5
299 182 ba 1f
300 183 1:
301 184 wrpr %g1, %cwp
302 185 stn %g4, [%o2]
303 186 retl
↓ open down ↓ |
45 lines elided |
↑ open up ↑ |
304 187 clr %o0 ! Success; return 0.
305 188 2:
306 189 !
307 190 ! The frame that we're looking for has been flushed to the stack; the
308 191 ! caller will be forced to
309 192 !
310 193 retl
311 194 add %g2, 1, %o0 ! Failure; return deepest frame + 1
312 195 SET_SIZE(dtrace_fish)
313 196
314 -#endif
315 -
316 -#if defined(lint)
317 -
318 -/*ARGSUSED*/
319 -void
320 -dtrace_copyin(uintptr_t uaddr, uintptr_t kaddr, size_t size,
321 - volatile uint16_t *flags)
322 -{}
323 -
324 -#else
325 -
326 197 ENTRY(dtrace_copyin)
327 198 tst %o2
328 199 bz 2f
329 200 clr %g1
330 201 lduba [%o0 + %g1]ASI_USER, %g2
331 202 0:
332 203 ! check for an error if the count is 4k-aligned
333 204 andcc %g1, 0xfff, %g0
334 205 bnz,pt %icc, 1f
335 206 stub %g2, [%o1 + %g1]
336 207 lduh [%o3], %g3
337 208 andcc %g3, CPU_DTRACE_BADADDR, %g0
338 209 bnz,pn %icc, 2f
339 210 nop
340 211 1:
↓ open down ↓ |
5 lines elided |
↑ open up ↑ |
341 212 inc %g1
342 213 cmp %g1, %o2
343 214 bl,a 0b
344 215 lduba [%o0 + %g1]ASI_USER, %g2
345 216 2:
346 217 retl
347 218 nop
348 219
349 220 SET_SIZE(dtrace_copyin)
350 221
351 -#endif
352 -
353 -#if defined(lint)
354 -
355 -/*ARGSUSED*/
356 -void
357 -dtrace_copyinstr(uintptr_t uaddr, uintptr_t kaddr, size_t size,
358 - volatile uint16_t *flags)
359 -{}
360 -
361 -#else
362 -
363 222 ENTRY(dtrace_copyinstr)
364 223 tst %o2
365 224 bz 2f
366 225 clr %g1
367 226 lduba [%o0 + %g1]ASI_USER, %g2
368 227 0:
369 228 stub %g2, [%o1 + %g1] ! Store byte
370 229
371 230 ! check for an error if the count is 4k-aligned
372 231 andcc %g1, 0xfff, %g0
373 232 bnz,pt %icc, 1f
374 233 inc %g1
375 234 lduh [%o3], %g3
376 235 andcc %g3, CPU_DTRACE_BADADDR, %g0
377 236 bnz,pn %icc, 2f
378 237 nop
379 238 1:
380 239 cmp %g2, 0 ! Was that '\0'?
↓ open down ↓ |
8 lines elided |
↑ open up ↑ |
381 240 be 2f ! If so, we're done
382 241 cmp %g1, %o2 ! Compare to limit
383 242 bl,a 0b ! If less, take another lap
384 243 lduba [%o0 + %g1]ASI_USER, %g2 ! delay: load user byte
385 244 2:
386 245 retl
387 246 nop
388 247
389 248 SET_SIZE(dtrace_copyinstr)
390 249
391 -#endif
392 -
393 -#if defined(lint)
394 -
395 -/*ARGSUSED*/
396 -void
397 -dtrace_copyout(uintptr_t kaddr, uintptr_t uaddr, size_t size,
398 - volatile uint16_t *flags)
399 -{}
400 -
401 -#else
402 -
403 250 ENTRY(dtrace_copyout)
404 251 tst %o2
405 252 bz 2f
406 253 clr %g1
407 254 ldub [%o0 + %g1], %g2
408 255 0:
409 256 ! check for an error if the count is 4k-aligned
410 257 andcc %g1, 0xfff, %g0
411 258 bnz,pt %icc, 1f
412 259 stba %g2, [%o1 + %g1]ASI_USER
413 260 lduh [%o3], %g3
414 261 andcc %g3, CPU_DTRACE_BADADDR, %g0
415 262 bnz,pn %icc, 2f
416 263 nop
↓ open down ↓ |
4 lines elided |
↑ open up ↑ |
417 264 1:
418 265 inc %g1
419 266 cmp %g1, %o2
420 267 bl,a 0b
421 268 ldub [%o0 + %g1], %g2
422 269 2:
423 270 retl
424 271 nop
425 272 SET_SIZE(dtrace_copyout)
426 273
427 -#endif
428 -
429 -#if defined(lint)
430 -
431 -/*ARGSUSED*/
432 -void
433 -dtrace_copyoutstr(uintptr_t kaddr, uintptr_t uaddr, size_t size,
434 - volatile uint16_t *flags)
435 -{}
436 -
437 -#else
438 -
439 274 ENTRY(dtrace_copyoutstr)
440 275 tst %o2
441 276 bz 2f
442 277 clr %g1
443 278 ldub [%o0 + %g1], %g2
444 279 0:
445 280 stba %g2, [%o1 + %g1]ASI_USER
446 281
447 282 ! check for an error if the count is 4k-aligned
448 283 andcc %g1, 0xfff, %g0
449 284 bnz,pt %icc, 1f
450 285 inc %g1
451 286 lduh [%o3], %g3
452 287 andcc %g3, CPU_DTRACE_BADADDR, %g0
453 288 bnz,pn %icc, 2f
454 289 nop
455 290 1:
↓ open down ↓ |
7 lines elided |
↑ open up ↑ |
456 291 cmp %g2, 0
457 292 be 2f
458 293 cmp %g1, %o2
459 294 bl,a 0b
460 295 ldub [%o0 + %g1], %g2
461 296 2:
462 297 retl
463 298 nop
464 299 SET_SIZE(dtrace_copyoutstr)
465 300
466 -#endif
467 -
468 -#if defined(lint)
469 -
470 -/*ARGSUSED*/
471 -uintptr_t
472 -dtrace_fulword(void *addr)
473 -{ return (0); }
474 -
475 -#else
476 -
477 301 ENTRY(dtrace_fulword)
478 302 clr %o1
479 303 ldna [%o0]ASI_USER, %o1
480 304 retl
481 305 mov %o1, %o0
482 306 SET_SIZE(dtrace_fulword)
483 307
484 -#endif
485 -
486 -#if defined(lint)
487 -
488 -/*ARGSUSED*/
489 -uint8_t
490 -dtrace_fuword8(void *addr)
491 -{ return (0); }
492 -
493 -#else
494 -
495 308 ENTRY(dtrace_fuword8)
496 309 clr %o1
497 310 lduba [%o0]ASI_USER, %o1
498 311 retl
499 312 mov %o1, %o0
500 313 SET_SIZE(dtrace_fuword8)
501 314
502 -#endif
503 -
504 -#if defined(lint)
505 -
506 -/*ARGSUSED*/
507 -uint16_t
508 -dtrace_fuword16(void *addr)
509 -{ return (0); }
510 -
511 -#else
512 -
513 315 ENTRY(dtrace_fuword16)
514 316 clr %o1
515 317 lduha [%o0]ASI_USER, %o1
516 318 retl
517 319 mov %o1, %o0
518 320 SET_SIZE(dtrace_fuword16)
519 321
520 -#endif
521 -
522 -#if defined(lint)
523 -
524 -/*ARGSUSED*/
525 -uint32_t
526 -dtrace_fuword32(void *addr)
527 -{ return (0); }
528 -
529 -#else
530 -
531 322 ENTRY(dtrace_fuword32)
532 323 clr %o1
533 324 lda [%o0]ASI_USER, %o1
534 325 retl
535 326 mov %o1, %o0
536 327 SET_SIZE(dtrace_fuword32)
537 328
538 -#endif
539 -
540 -#if defined(lint)
541 -
542 -/*ARGSUSED*/
543 -uint64_t
544 -dtrace_fuword64(void *addr)
545 -{ return (0); }
546 -
547 -#else
548 -
549 329 ENTRY(dtrace_fuword64)
550 330 clr %o1
551 331 ldxa [%o0]ASI_USER, %o1
552 332 retl
553 333 mov %o1, %o0
554 334 SET_SIZE(dtrace_fuword64)
555 335
556 -#endif
557 -
558 -#if defined(lint)
559 -
560 -/*ARGSUSED*/
561 -int
562 -dtrace_getupcstack_top(uint64_t *pcstack, int pcstack_limit, uintptr_t *sp)
563 -{ return (0); }
564 -
565 -#else
566 -
567 336 /*
568 337 * %g1 pcstack
569 338 * %g2 current window
570 339 * %g3 maxwin (nwindows - 1)
571 340 * %g4 saved %cwp (so we can get back to the original window)
572 341 * %g5 iteration count
573 342 * %g6 saved %fp
574 343 *
575 344 * %o0 pcstack / return value (iteration count)
576 345 * %o1 pcstack_limit
577 346 * %o2 last_fp
578 347 */
579 348
580 349 ENTRY(dtrace_getupcstack_top)
581 350 mov %o0, %g1 ! we need the pcstack pointer while
582 351 ! we're visiting other windows
583 352
584 353 rdpr %otherwin, %g5 ! compute the number of iterations
585 354 cmp %g5, %o1 ! (windows to observe) by taking the
586 355 movg %icc, %o1, %g5 ! min of %otherwin and pcstack_limit
587 356
588 357 brlez,a,pn %g5, 2f ! return 0 if count <= 0
589 358 clr %o0
590 359
591 360 sethi %hi(nwin_minus_one), %g3 ! hang onto maxwin since we'll need
592 361 ld [%g3 + %lo(nwin_minus_one)], %g3 ! it for our modular arithmetic
593 362
594 363 rdpr %cwp, %g4 ! remember our window so we can return
595 364 rdpr %canrestore, %g2 ! compute the first non-user window
596 365 subcc %g4, %g2, %g2 ! current = %cwp - %canrestore
597 366
598 367 bge,pt %xcc, 1f ! good to go if current is >= 0
599 368 mov %g5, %o0 ! we need to return the count
600 369
601 370 add %g2, %g3, %g2 ! normalize our current window if it's
602 371 add %g2, 1, %g2 ! less than zero
603 372
604 373 ! note that while it's tempting, we can't execute restore to decrement
605 374 ! the %cwp by one (mod nwindows) because we're in the user's windows
606 375 1:
607 376 deccc %g2 ! decrement the current window
608 377 movl %xcc, %g3, %g2 ! normalize if it's negative (-1)
609 378
610 379 wrpr %g2, %cwp ! change windows
611 380
612 381 stx %i7, [%g1] ! stash the return address in pcstack
613 382
614 383 deccc %g5 ! decrement the count
615 384 bnz,pt %icc, 1b ! we iterate until the count reaches 0
616 385 add %g1, 8, %g1 ! increment the pcstack pointer
617 386
618 387 mov %i6, %g6 ! stash the last frame pointer we
619 388 ! encounter so the caller can
620 389 ! continue the stack walk in memory
↓ open down ↓ |
44 lines elided |
↑ open up ↑ |
621 390
622 391 wrpr %g4, %cwp ! change back to the original window
623 392
624 393 stn %g6, [%o2] ! return the last frame pointer
625 394
626 395 2:
627 396 retl
628 397 nop
629 398 SET_SIZE(dtrace_getupcstack_top)
630 399
631 -#endif
632 -
633 -#if defined(lint)
634 -
635 -/*ARGSUSED*/
636 -int
637 -dtrace_getustackdepth_top(uintptr_t *sp)
638 -{ return (0); }
639 -
640 -#else
641 -
642 400 ENTRY(dtrace_getustackdepth_top)
643 401 mov %o0, %o2
644 402 rdpr %otherwin, %o0
645 403
646 404 brlez,a,pn %o0, 2f ! return 0 if there are no user wins
647 405 clr %o0
648 406
649 407 rdpr %cwp, %g4 ! remember our window so we can return
650 408 rdpr %canrestore, %g2 ! compute the first user window
651 409 sub %g4, %g2, %g2 ! current = %cwp - %canrestore -
652 410 subcc %g2, %o0, %g2 ! %otherwin
653 411
654 412 bge,pt %xcc, 1f ! normalize the window if necessary
655 413 sethi %hi(nwin_minus_one), %g3
656 414 ld [%g3 + %lo(nwin_minus_one)], %g3
657 415 add %g2, %g3, %g2
658 416 add %g2, 1, %g2
659 417
660 418 1:
661 419 wrpr %g2, %cwp ! change to the first user window
↓ open down ↓ |
10 lines elided |
↑ open up ↑ |
662 420 mov %i6, %g6 ! stash the frame pointer
663 421 wrpr %g4, %cwp ! change back to the original window
664 422
665 423 stn %g6, [%o2] ! return the frame pointer
666 424
667 425 2:
668 426 retl
669 427 nop
670 428 SET_SIZE(dtrace_getustackdepth_top)
671 429
672 -#endif
673 -
674 -#if defined(lint) || defined(__lint)
675 -
676 -/* ARGSUSED */
677 -ulong_t
678 -dtrace_getreg_win(uint_t reg, uint_t depth)
679 -{ return (0); }
680 -
681 -#else /* lint */
682 -
683 430 ENTRY(dtrace_getreg_win)
684 431 sub %o0, 16, %o0
685 432 cmp %o0, 16 ! %o0 must begin in the range [16..32)
686 433 blu,pt %xcc, 1f
687 434 nop
688 435 retl
689 436 clr %o0
690 437
691 438 1:
692 439 set dtrace_getreg_win_table, %g3
693 440 sll %o0, 2, %o0
694 441 add %g3, %o0, %g3
695 442
696 443 rdpr %canrestore, %o3
697 444 rdpr %cwp, %g2
698 445
699 446 ! Set %cwp to be (%cwp - %canrestore - %o1) mod NWINDOWS
700 447
701 448 sub %g2, %o3, %o2 ! %o2 is %cwp - %canrestore
702 449 subcc %o2, %o1, %o4
703 450 bge,a,pn %xcc, 2f
704 451 wrpr %o4, %cwp
705 452
706 453 sethi %hi(nwin_minus_one), %o3
707 454 ld [%o3 + %lo(nwin_minus_one)], %o3
708 455
709 456 add %o2, %o3, %o4
710 457 wrpr %o4, %cwp
711 458 2:
712 459 jmp %g3
713 460 ba 3f
714 461 3:
715 462 wrpr %g2, %cwp
716 463 retl
717 464 mov %g1, %o0
718 465
719 466 dtrace_getreg_win_table:
720 467 mov %l0, %g1
721 468 mov %l1, %g1
722 469 mov %l2, %g1
723 470 mov %l3, %g1
724 471 mov %l4, %g1
725 472 mov %l5, %g1
726 473 mov %l6, %g1
727 474 mov %l7, %g1
↓ open down ↓ |
35 lines elided |
↑ open up ↑ |
728 475 mov %i0, %g1
729 476 mov %i1, %g1
730 477 mov %i2, %g1
731 478 mov %i3, %g1
732 479 mov %i4, %g1
733 480 mov %i5, %g1
734 481 mov %i6, %g1
735 482 mov %i7, %g1
736 483 SET_SIZE(dtrace_getreg_win)
737 484
738 -#endif /* lint */
739 -
740 -#if defined(lint) || defined(__lint)
741 -
742 -/* ARGSUSED */
743 -void
744 -dtrace_putreg_win(uint_t reg, ulong_t value)
745 -{}
746 -
747 -#else /* lint */
748 -
749 485 ENTRY(dtrace_putreg_win)
750 486 sub %o0, 16, %o0
751 487 cmp %o0, 16 ! %o0 must be in the range [16..32)
752 488 blu,pt %xcc, 1f
753 489 nop
754 490 retl
755 491 nop
756 492
757 493 1:
758 494 mov %o1, %g1 ! move the value into a global register
759 495
760 496 set dtrace_putreg_table, %g3
761 497 sll %o0, 2, %o0
762 498 add %g3, %o0, %g3
763 499
764 500 rdpr %canrestore, %o3
765 501 rdpr %cwp, %g2
766 502
767 503 ! Set %cwp to be (%cwp - %canrestore - 1) mod NWINDOWS
768 504
769 505 sub %g2, %o3, %o2 ! %o2 is %cwp - %canrestore
770 506 subcc %o2, 1, %o4
771 507 bge,a,pn %xcc, 2f
772 508 wrpr %o4, %cwp
773 509
774 510 sethi %hi(nwin_minus_one), %o3
775 511 ld [%o3 + %lo(nwin_minus_one)], %o3
776 512 add %o2, %o3, %o4
777 513 wrpr %o4, %cwp
778 514 2:
779 515 jmp %g3
780 516 ba 3f
781 517 3:
782 518 wrpr %g2, %cwp
783 519 retl
784 520 nop
785 521
786 522 dtrace_putreg_table:
787 523 mov %g1, %l0
788 524 mov %g1, %l1
789 525 mov %g1, %l2
790 526 mov %g1, %l3
791 527 mov %g1, %l4
792 528 mov %g1, %l5
793 529 mov %g1, %l6
794 530 mov %g1, %l7
↓ open down ↓ |
36 lines elided |
↑ open up ↑ |
795 531 mov %g1, %i0
796 532 mov %g1, %i1
797 533 mov %g1, %i2
798 534 mov %g1, %i3
799 535 mov %g1, %i4
800 536 mov %g1, %i5
801 537 mov %g1, %i6
802 538 mov %g1, %i7
803 539 SET_SIZE(dtrace_putreg_win)
804 540
805 -#endif /* lint */
806 -
807 -#if defined(lint) || defined(__lint)
808 -
809 -/*ARGSUSED*/
810 -void
811 -dtrace_probe_error(dtrace_state_t *state, dtrace_epid_t epid, int which,
812 - int fault, int fltoffs, uintptr_t illval)
813 -{}
814 -
815 -#else /* lint */
816 -
817 541 ENTRY(dtrace_probe_error)
818 542 save %sp, -SA(MINFRAME), %sp
819 543 sethi %hi(dtrace_probeid_error), %l0
820 544 ld [%l0 + %lo(dtrace_probeid_error)], %o0
821 545 mov %i0, %o1
822 546 mov %i1, %o2
823 547 mov %i2, %o3
824 548 mov %i3, %o4
825 549 call dtrace_probe
826 550 mov %i4, %o5
827 551 ret
828 552 restore
829 553 SET_SIZE(dtrace_probe_error)
830 554
831 -#endif
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX