Print this page
de-linting of .s files

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/sun4u/ml/trap_table.s
          +++ new/usr/src/uts/sun4u/ml/trap_table.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 2009 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25   
  26      -#if !defined(lint)
  27   26  #include "assym.h"
  28      -#endif /* !lint */
  29   27  #include <sys/asm_linkage.h>
  30   28  #include <sys/privregs.h>
  31   29  #include <sys/sun4asi.h>
  32   30  #include <sys/spitregs.h>
  33   31  #include <sys/cheetahregs.h>
  34   32  #include <sys/machtrap.h>
  35   33  #include <sys/machthread.h>
  36   34  #include <sys/machbrand.h>
  37   35  #include <sys/pcb.h>
  38   36  #include <sys/pte.h>
↓ open down ↓ 71 lines elided ↑ open up ↑
 110  108  #endif
 111  109  
 112  110  /*
 113  111   * This first set are funneled to trap() with %tt as the type.
 114  112   * Trap will then either panic or send the user a signal.
 115  113   */
 116  114  /*
 117  115   * NOT is used for traps that just shouldn't happen.
 118  116   * It comes in both single and quadruple flavors.
 119  117   */
 120      -#if !defined(lint)
 121  118          .global trap
 122      -#endif /* !lint */
 123  119  #define NOT                     \
 124  120          TT_TRACE(trace_gen)     ;\
 125  121          set     trap, %g1       ;\
 126  122          rdpr    %tt, %g3        ;\
 127  123          ba,pt   %xcc, sys_trap  ;\
 128  124          sub     %g0, 1, %g4     ;\
 129  125          .align  32
 130  126  #define NOT4    NOT; NOT; NOT; NOT
 131  127  /*
 132  128   * RED is for traps that use the red mode handler.
↓ open down ↓ 9 lines elided ↑ open up ↑
 142  138  #define BAD4    NOT4
 143  139  
 144  140  #define DONE                    \
 145  141          done;                   \
 146  142          .align  32
 147  143  
 148  144  /*
 149  145   * TRAP vectors to the trap() function.
 150  146   * It's main use is for user errors.
 151  147   */
 152      -#if !defined(lint)
 153  148          .global trap
 154      -#endif /* !lint */
 155  149  #define TRAP(arg)               \
 156  150          TT_TRACE(trace_gen)     ;\
 157  151          set     trap, %g1       ;\
 158  152          mov     arg, %g3        ;\
 159  153          ba,pt   %xcc, sys_trap  ;\
 160  154          sub     %g0, 1, %g4     ;\
 161  155          .align  32
 162  156  
 163  157  /*
 164  158   * SYSCALL is used for unsupported syscall interfaces (with 'which'
↓ open down ↓ 108 lines elided ↑ open up ↑
 273  267   */
 274  268  #define CLEAN_WINDOW                                            \
 275  269          TT_TRACE_L(trace_win)                                   ;\
 276  270          rdpr %cleanwin, %l0; inc %l0; wrpr %l0, %cleanwin       ;\
 277  271          clr %l0; clr %l1; clr %l2; clr %l3                      ;\
 278  272          clr %l4; clr %l5; clr %l6; clr %l7                      ;\
 279  273          clr %o0; clr %o1; clr %o2; clr %o3                      ;\
 280  274          clr %o4; clr %o5; clr %o6; clr %o7                      ;\
 281  275          retry; .align 128
 282  276  
 283      -#if !defined(lint)
 284      -
 285  277  /*
 286  278   * If we get an unresolved tlb miss while in a window handler, the fault
 287  279   * handler will resume execution at the last instruction of the window
 288  280   * hander, instead of delivering the fault to the kernel.  Spill handlers
 289  281   * use this to spill windows into the wbuf.
 290  282   *
 291  283   * The mixed handler works by checking %sp, and branching to the correct
 292  284   * handler.  This is done by branching back to label 1: for 32b frames,
 293  285   * or label 2: for 64b frames; which implies the handler order is: 32b,
 294  286   * 64b, mixed.  The 1: and 2: labels are offset into the routines to
↓ open down ↓ 398 lines elided ↑ open up ↑
 693  685          ldxa    [%sp + V9BIAS64 + 96]%asi, %i4                  ;\
 694  686          ldxa    [%sp + V9BIAS64 + 104]%asi, %i5                 ;\
 695  687          ldxa    [%sp + V9BIAS64 + 112]%asi, %i6                 ;\
 696  688          ldxa    [%sp + V9BIAS64 + 120]%asi, %i7                 ;\
 697  689          restored                                                ;\
 698  690          retry                                                   ;\
 699  691          SKIP(31-19-TT_TRACE_L_INS)                              ;\
 700  692          ba,a,pt %xcc, fault_64bit_/**/tail                      ;\
 701  693          .empty
 702  694  
 703      -#endif /* !lint */
 704      -
 705  695  /*
 706  696   * SPILL_mixed spills either size window, depending on
 707  697   * whether %sp is even or odd, to a 32-bit address space.
 708  698   * This may only be used in conjunction with SPILL_32bit/
 709  699   * SPILL_64bit. New versions of SPILL_mixed_{tt1,asi} would be
 710  700   * needed for use with SPILL_{32,64}bit_{tt1,asi}.  Particular
 711  701   * attention should be paid to the instructions that belong
 712  702   * in the delay slots of the branches depending on the type
 713  703   * of spill handler being branched to.
 714  704   * Clear upper 32 bits of %sp if it is odd.
↓ open down ↓ 123 lines elided ↑ open up ↑
 838  828          ba,pt   %xcc,.fp_ieee_exception ;\
 839  829          nop                             ;\
 840  830          .align  32
 841  831  
 842  832  #define FP_TRAP                         \
 843  833          TT_TRACE(trace_gen)             ;\
 844  834          ba,pt   %xcc,.fp_exception      ;\
 845  835          nop                             ;\
 846  836          .align  32
 847  837  
 848      -#if !defined(lint)
 849  838  /*
 850  839   * asynchronous traps at level 0 and level 1
 851  840   *
 852  841   * The first instruction must be a membar for UltraSPARC-III
 853  842   * to stop RED state entry if the store queue has many
 854  843   * pending bad stores (PRM, Chapter 11).
 855  844   */
 856  845  #define ASYNC_TRAP(ttype, ttlabel, table_name)\
 857  846          .global table_name      ;\
 858  847  table_name:                     ;\
↓ open down ↓ 5 lines elided ↑ open up ↑
 864  853  
 865  854  /*
 866  855   * Defaults to BAD entry, but establishes label to be used for
 867  856   * architecture-specific overwrite of trap table entry.
 868  857   */
 869  858  #define LABELED_BAD(table_name)         \
 870  859          .global table_name              ;\
 871  860  table_name:                             ;\
 872  861          BAD
 873  862  
 874      -#endif /* !lint */
 875      -
 876  863  /*
 877  864   * illegal instruction trap
 878  865   */
 879  866  #define ILLTRAP_INSTR                     \
 880  867          membar  #Sync                     ;\
 881  868          TT_TRACE(trace_gen)               ;\
 882  869          or      %g0, P_UTRAP4, %g2        ;\
 883  870          or      %g0, T_UNIMP_INSTR, %g3   ;\
 884  871          sethi   %hi(.check_v9utrap), %g4  ;\
 885  872          jmp     %g4 + %lo(.check_v9utrap) ;\
↓ open down ↓ 426 lines elided ↑ open up ↑
1312 1299          ldxa    [%g0]ASI_DMMU, %g4                                      ;\
1313 1300          cmp     %g6, FAST_IMMU_MISS_TT                                  ;\
1314 1301          movne   %icc, %g4, %g1                                          ;\
1315 1302          stxa    %g1, [%g3 + TRAP_ENT_TSTATE]%asi /* tsb tag */          ;\
1316 1303          stxa    %g0, [%g3 + TRAP_ENT_TR]%asi                            ;\
1317 1304          TRACE_NEXT(%g3, %g4, %g6)
1318 1305  #else
1319 1306  #define TRACE_TSBHIT(ttextra)
1320 1307  #endif
1321 1308  
1322      -#if defined(lint)
1323      -
1324      -struct scb      trap_table;
1325      -struct scb      scb;            /* trap_table/scb are the same object */
1326      -
1327      -#else /* lint */
1328      -
1329 1309  /*
1330 1310   * =======================================================================
1331 1311   *              SPARC V9 TRAP TABLE
1332 1312   *
1333 1313   * The trap table is divided into two halves: the first half is used when
1334 1314   * taking traps when TL=0; the second half is used when taking traps from
1335 1315   * TL>0. Note that handlers in the second half of the table might not be able
1336 1316   * to make the same assumptions as handlers in the first half of the table.
1337 1317   *
1338 1318   * Worst case trap nesting so far:
↓ open down ↓ 1719 lines elided ↑ open up ↑
3058 3038          ENTRY_NP(syscall_wrapper32)
3059 3039          BRAND_CALLBACK(BRAND_CB_SYSCALL32)
3060 3040          SYSCALL_NOTT(syscall_trap32)
3061 3041          SET_SIZE(syscall_wrapper32)
3062 3042  
3063 3043          ENTRY_NP(syscall_wrapper)
3064 3044          BRAND_CALLBACK(BRAND_CB_SYSCALL)
3065 3045          SYSCALL_NOTT(syscall_trap)
3066 3046          SET_SIZE(syscall_wrapper)
3067 3047  
3068      -#endif  /* lint */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX