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
↓ 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
↓ 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
↓ 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]
↓ 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
↓ 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
↓ 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
↓ 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
↓ 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 -
↓ 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
↓ 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
↓ 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