Print this page
de-linting of .s files

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/sun4u/io/panther_asm.s
          +++ new/usr/src/uts/sun4u/io/panther_asm.s
↓ open down ↓ 17 lines elided ↑ open up ↑
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   *
  25   25   * Assembly code support for the Cheetah+ module
  26   26   */
  27   27  
  28      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  29      -
  30      -#if !defined(lint)
  31   28  #include "assym.h"
  32      -#endif  /* lint */
  33   29  
  34   30  #include <sys/asm_linkage.h>
  35   31  #include <sys/mmu.h>
  36   32  #include <vm/hat_sfmmu.h>
  37   33  #include <sys/machparam.h>
  38   34  #include <sys/machcpuvar.h>
  39   35  #include <sys/machthread.h>
  40   36  #include <sys/machtrap.h>
  41   37  #include <sys/privregs.h>
  42   38  #include <sys/asm_linkage.h>
↓ open down ↓ 4 lines elided ↑ open up ↑
  47   43  #include <sys/async.h>
  48   44  #include <sys/clock.h>
  49   45  #include <sys/cheetahasm.h>
  50   46  #include <sys/cmpregs.h>
  51   47  
  52   48  #ifdef TRAPTRACE
  53   49  #include <sys/traptrace.h>
  54   50  #endif /* TRAPTRACE */
  55   51  
  56   52  
  57      -#if !defined(lint)
  58      -
  59   53          .global retire_l2_start
  60   54          .global retire_l2_end
  61   55          .global unretire_l2_start
  62   56          .global unretire_l2_end
  63   57          .global retire_l3_start
  64   58          .global retire_l3_end
  65   59          .global unretire_l3_start
  66   60          .global unretire_l3_end
  67   61  
  68   62  /*
↓ open down ↓ 51 lines elided ↑ open up ↑
 120  114          set     PN_L3_IDX_DISP_FLUSH, l2_idx_out;                               \
 121  115          or      l2_idx_out, l3_idx_out, l3_idx_out;                             \
 122  116          set     PN_L2_SET_SIZE, l2_idx_out;                                     \
 123  117          sub     l2_idx_out, 1, l2_idx_out;                                      \
 124  118          and     physaddr, l2_idx_out, l2_idx_out;                               \
 125  119          set     PN_L2_IDX_DISP_FLUSH, scr3;                                     \
 126  120          or      l2_idx_out, scr3, l2_idx_out;                                   \
 127  121          PN_ECACHE_REFLUSH_LINE(l2_idx_out, l3_idx_out, scr3, scr4)
 128  122  
 129  123  
 130      -#endif  /* !lint */
 131      -
 132      -#if defined(lint)
 133      -
 134      -/*ARGSUSED*/
 135      -int
 136      -retire_l2(uint64_t tag_addr, uint64_t pattern)
 137      -{return 0;}
 138      -
 139      -#else
 140  124          .align 4096
 141  125          ENTRY(retire_l2)
 142  126  retire_l2_start:
 143  127  
 144  128          ! since we disable interrupts, we don't need to do kpreempt_disable()
 145  129          rdpr    %pstate, %o2
 146  130          andn    %o2, PSTATE_IE, %g1
 147  131          wrpr    %g0, %g1, %pstate               ! disable interrupts
 148  132          /*
 149  133           * Save current DCU state.  Turn off IPS
↓ open down ↓ 41 lines elided ↑ open up ↑
 191  175          cmp     %o5, 0
 192  176          be,a,pt %xcc, 8b        ! Flush the cacheline again
 193  177           mov    2, %o5  ! indicate retry was done
 194  178          ! We already Flushed cacheline second time. Return -1
 195  179          clr     %o5
 196  180          ba      9b
 197  181           dec    %o5
 198  182  retire_l2_end:
 199  183          SET_SIZE(retire_l2)
 200  184  
 201      -#endif  /* lint */
 202      -
 203      -#if defined(lint)
 204      -
 205      -/*
 206      - */
 207      -/*ARGSUSED*/
 208      -int
 209      -unretire_l2(uint64_t tag_addr, uint64_t pattern)
 210      -{return 0;}
 211      -
 212      -#else
 213  185          ENTRY(unretire_l2)
 214  186  unretire_l2_start:
 215  187  
 216  188          ! since we disable interrupts, we don't need to do kpreempt_disable()
 217  189          rdpr    %pstate, %o2
 218  190          andn    %o2, PSTATE_IE, %g1
 219  191          wrpr    %g0, %g1, %pstate               ! disable interrupts
 220  192          /*
 221  193           * Save current DCU state.  Turn off IPS
 222  194           */
↓ open down ↓ 27 lines elided ↑ open up ↑
 250  222           * Restore the DCU
 251  223           */
 252  224          stxa    %g1, [%g0]ASI_DCU
 253  225          flush   %g0
 254  226          wrpr    %g0, %o2, %pstate               !restore pstate
 255  227          retl
 256  228           mov    %o5, %o0
 257  229  unretire_l2_end:
 258  230          SET_SIZE(unretire_l2)
 259  231  
 260      -#endif  /* lint */
 261      -
 262      -#if defined(lint)
 263      -
 264      -/*ARGSUSED*/
 265      -int
 266      -retire_l3(uint64_t tag_addr, uint64_t pattern)
 267      -{return 0;}
 268      -
 269      -#else
 270  232          ENTRY(retire_l3)
 271  233  retire_l3_start:
 272  234  
 273  235          ! since we disable interrupts, we don't need to do kpreempt_disable()
 274  236          rdpr    %pstate, %o2
 275  237          andn    %o2, PSTATE_IE, %g1
 276  238          wrpr    %g0, %g1, %pstate               ! disable interrupts
 277  239          /*
 278  240           * Save current DCU state.  Turn off IPS
 279  241           */
↓ open down ↓ 36 lines elided ↑ open up ↑
 316  278          and     %o3, 0x7, %o3
 317  279          cmp     %o3, 0x5
 318  280          be,a,pt %xcc, 9b
 319  281           inc    %o5     ! indicate was already NA
 320  282          ! Hmm.  Not INV, not NA
 321  283          ba      9b
 322  284           dec    %o5
 323  285  retire_l3_end:
 324  286          SET_SIZE(retire_l3)
 325  287  
 326      -#endif  /* lint */
 327      -
 328      -#if defined(lint)
 329      -
 330      -/*
 331      - */
 332      -/*ARGSUSED*/
 333      -int
 334      -unretire_l3(uint64_t tag_addr, uint64_t pattern)
 335      -{return 0;}
 336      -
 337      -#else
 338  288          ENTRY(unretire_l3)
 339  289  unretire_l3_start:
 340  290  
 341  291          ! since we disable interrupts, we don't need to do kpreempt_disable()
 342  292          rdpr    %pstate, %o2
 343  293          andn    %o2, PSTATE_IE, %g1
 344  294          wrpr    %g0, %g1, %pstate               ! disable interrupts
 345  295          /*
 346  296           * Save current DCU state.  Turn off IPS
 347  297           */
↓ open down ↓ 27 lines elided ↑ open up ↑
 375  325           * Restore the DCU
 376  326           */
 377  327          stxa    %g1, [%g0]ASI_DCU
 378  328          flush   %g0
 379  329          wrpr    %g0, %o2, %pstate               !restore pstate
 380  330          retl
 381  331           mov    %o5, %o0
 382  332  unretire_l3_end:
 383  333          SET_SIZE(unretire_l3)
 384  334  
 385      -#endif  /* lint */
 386      -
 387      -#if defined(lint)
 388      -
 389      -/*ARGSUSED*/
 390      -int
 391      -retire_l2_alternate(uint64_t tag_addr, uint64_t pattern)
 392      -{return 0;}
 393      -
 394      -#else
 395  335          .align 2048
 396  336  
 397  337          ENTRY(retire_l2_alternate)
 398  338  
 399  339          ! since we disable interrupts, we don't need to do kpreempt_disable()
 400  340          rdpr    %pstate, %o2
 401  341          andn    %o2, PSTATE_IE, %g1
 402  342          wrpr    %g0, %g1, %pstate               ! disable interrupts
 403  343          /*
 404  344           * Save current DCU state.  Turn off IPS
↓ open down ↓ 40 lines elided ↑ open up ↑
 445  385          ! Hmm.  Not INV, not NA.
 446  386          cmp     %o5, 0
 447  387          be,a,pt %xcc, 8b        ! Flush the cacheline again
 448  388           mov    2, %o5  ! indicate retry was done
 449  389          ! We already Flushed cacheline second time. Return -1
 450  390          clr     %o5
 451  391          ba      9b
 452  392           dec    %o5
 453  393          SET_SIZE(retire_l2_alternate)
 454  394  
 455      -#endif  /* lint */
 456      -
 457      -#if defined(lint)
 458      -
 459      -/*
 460      - */
 461      -/*ARGSUSED*/
 462      -int
 463      -unretire_l2_alternate(uint64_t tag_addr, uint64_t pattern)
 464      -{return 0;}
 465      -
 466      -#else
 467  395          ENTRY(unretire_l2_alternate)
 468  396  
 469  397          ! since we disable interrupts, we don't need to do kpreempt_disable()
 470  398          rdpr    %pstate, %o2
 471  399          andn    %o2, PSTATE_IE, %g1
 472  400          wrpr    %g0, %g1, %pstate               ! disable interrupts
 473  401          /*
 474  402           * Save current DCU state.  Turn off IPS
 475  403           */
 476  404          setx    DCU_IPS_MASK, %g2, %o3
↓ open down ↓ 25 lines elided ↑ open up ↑
 502  430          /*
 503  431           * Restore the DCU
 504  432           */
 505  433          stxa    %g1, [%g0]ASI_DCU
 506  434          flush   %g0
 507  435          wrpr    %g0, %o2, %pstate               !restore pstate
 508  436          retl
 509  437           mov    %o5, %o0
 510  438          SET_SIZE(unretire_l2_alternate)
 511  439  
 512      -#endif  /* lint */
 513      -
 514      -#if defined(lint)
 515      -
 516      -/*ARGSUSED*/
 517      -int
 518      -retire_l3_alternate(uint64_t tag_addr, uint64_t pattern)
 519      -{return 0;}
 520      -
 521      -#else
 522  440          ENTRY(retire_l3_alternate)
 523  441  
 524  442          ! since we disable interrupts, we don't need to do kpreempt_disable()
 525  443          rdpr    %pstate, %o2
 526  444          andn    %o2, PSTATE_IE, %g1
 527  445          wrpr    %g0, %g1, %pstate               ! disable interrupts
 528  446          /*
 529  447           * Save current DCU state.  Turn off IPS
 530  448           */
 531  449          setx    DCU_IPS_MASK, %g2, %o3
↓ open down ↓ 34 lines elided ↑ open up ↑
 566  484          ! It is OK to have STATE as NA (if so, nothing to do!)
 567  485          and     %o3, 0x7, %o3
 568  486          cmp     %o3, 0x5
 569  487          be,a,pt %xcc, 9b
 570  488           inc    %o5     ! indicate was already NA
 571  489          ! Hmm.  Not INV, not NA
 572  490          ba      9b
 573  491           dec    %o5
 574  492          SET_SIZE(retire_l3_alternate)
 575  493  
 576      -#endif  /* lint */
 577      -
 578      -#if defined(lint)
 579      -
 580      -/*
 581      - */
 582      -/*ARGSUSED*/
 583      -int
 584      -unretire_l3_alternate(uint64_t tag_addr, uint64_t pattern)
 585      -{return 0;}
 586      -
 587      -#else
 588  494          ENTRY(unretire_l3_alternate)
 589  495  
 590  496          ! since we disable interrupts, we don't need to do kpreempt_disable()
 591  497          rdpr    %pstate, %o2
 592  498          andn    %o2, PSTATE_IE, %g1
 593  499          wrpr    %g0, %g1, %pstate               ! disable interrupts
 594  500          /*
 595  501           * Save current DCU state.  Turn off IPS
 596  502           */
 597  503          setx    DCU_IPS_MASK, %g2, %o3
↓ open down ↓ 25 lines elided ↑ open up ↑
 623  529          /*
 624  530           * Restore the DCU
 625  531           */
 626  532          stxa    %g1, [%g0]ASI_DCU
 627  533          flush   %g0
 628  534          wrpr    %g0, %o2, %pstate               !restore pstate
 629  535          retl
 630  536           mov    %o5, %o0
 631  537          SET_SIZE(unretire_l3_alternate)
 632  538  
 633      -#endif  /* lint */
 634      -
 635      -#if defined(lint)
 636      -
 637      -/*ARGSUSED*/
 638      -void
 639      -get_ecache_dtags_tl1(uint64_t afar, ch_cpu_logout_t *clop)
 640      -{ }
 641      -
 642      -#else
 643  539          ENTRY(get_ecache_dtags_tl1)
 644  540  
 645  541  
 646  542          PARK_SIBLING_CORE(%g3, %g4, %g5)        
 647  543          add     %g2, CH_CLO_DATA + CH_CHD_EC_DATA, %g2
 648  544          rd      %asi, %g4
 649  545          wr      %g0, ASI_N, %asi
 650  546          GET_ECACHE_DTAGS(%g1, %g2, %g5, %g6, %g7)
 651  547          wr      %g4, %asi
 652  548          UNPARK_SIBLING_CORE(%g3, %g4, %g5)      ! can use %g3 again
 653  549  
 654  550          retry
 655  551          SET_SIZE(get_ecache_dtags_tl1)
 656  552  
 657      -#endif  /* lint */
 658      -
 659      -#if defined(lint)
 660      -/*ARGSUSED*/
 661      -void
 662      -get_l2_tag_tl1(uint64_t tag_addr, uint64_t tag_data_ptr)
 663      -{ }
 664      -
 665      -#else
 666  553          ENTRY(get_l2_tag_tl1)
 667  554  
 668  555          /*
 669  556           * Now read the tag data
 670  557           */
 671  558          ldxa    [%g1]ASI_L2_TAG, %g4            ! save tag_data
 672  559          stx     %g4, [%g2]
 673  560  
 674  561          retry
 675  562          SET_SIZE(get_l2_tag_tl1)
 676  563  
 677      -#endif  /* lint */
 678      -
 679      -#if defined(lint)
 680      -/*ARGSUSED*/
 681      -void
 682      -get_l3_tag_tl1(uint64_t tag_addr, uint64_t tag_data_ptr)
 683      -{ }
 684      -
 685      -#else
 686  564          ENTRY(get_l3_tag_tl1)
 687  565  
 688  566          /*
 689  567           * Now read the tag data
 690  568           */
 691  569          ldxa    [%g1]ASI_EC_DIAG, %g4           ! save tag_data
 692  570          stx     %g4, [%g2]
 693  571  
 694  572          retry
 695  573          SET_SIZE(get_l3_tag_tl1)
 696      -
 697      -#endif  /* lint */
 698  574  
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX