Print this page
de-linting of .s files

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/sun4v/ml/trap_table.s
          +++ new/usr/src/uts/sun4v/ml/trap_table.s
↓ 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 2009 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27      -#if !defined(lint)
  28   27  #include "assym.h"
  29      -#endif /* !lint */
  30   28  #include <sys/asm_linkage.h>
  31   29  #include <sys/privregs.h>
  32   30  #include <sys/sun4asi.h>
  33   31  #include <sys/machasi.h>
  34   32  #include <sys/hypervisor_api.h>
  35   33  #include <sys/machtrap.h>
  36   34  #include <sys/machthread.h>
  37   35  #include <sys/machbrand.h>
  38   36  #include <sys/pcb.h>
  39   37  #include <sys/pte.h>
↓ open down ↓ 71 lines elided ↑ open up ↑
 111  109  #endif
 112  110  
 113  111  /*
 114  112   * This first set are funneled to trap() with %tt as the type.
 115  113   * Trap will then either panic or send the user a signal.
 116  114   */
 117  115  /*
 118  116   * NOT is used for traps that just shouldn't happen.
 119  117   * It comes in both single and quadruple flavors.
 120  118   */
 121      -#if !defined(lint)
 122  119          .global trap
 123      -#endif /* !lint */
 124  120  #define NOT                     \
 125  121          TT_TRACE(trace_gen)     ;\
 126  122          set     trap, %g1       ;\
 127  123          rdpr    %tt, %g3        ;\
 128  124          ba,pt   %xcc, sys_trap  ;\
 129  125          sub     %g0, 1, %g4     ;\
 130  126          .align  32
 131  127  #define NOT4    NOT; NOT; NOT; NOT
 132  128  
 133  129  #define NOTP                            \
↓ open down ↓ 13 lines elided ↑ open up ↑
 147  143  #define BAD4    NOT4
 148  144  
 149  145  #define DONE                    \
 150  146          done;                   \
 151  147          .align  32
 152  148  
 153  149  /*
 154  150   * TRAP vectors to the trap() function.
 155  151   * It's main use is for user errors.
 156  152   */
 157      -#if !defined(lint)
 158  153          .global trap
 159      -#endif /* !lint */
 160  154  #define TRAP(arg)               \
 161  155          TT_TRACE(trace_gen)     ;\
 162  156          set     trap, %g1       ;\
 163  157          mov     arg, %g3        ;\
 164  158          ba,pt   %xcc, sys_trap  ;\
 165  159          sub     %g0, 1, %g4     ;\
 166  160          .align  32
 167  161  
 168  162  /*
 169  163   * SYSCALL is used for unsupported syscall interfaces (with 'which'
↓ open down ↓ 96 lines elided ↑ open up ↑
 266  260   */
 267  261  #define CLEAN_WINDOW                                            \
 268  262          TT_TRACE_L(trace_win)                                   ;\
 269  263          rdpr %cleanwin, %l0; inc %l0; wrpr %l0, %cleanwin       ;\
 270  264          clr %l0; clr %l1; clr %l2; clr %l3                      ;\
 271  265          clr %l4; clr %l5; clr %l6; clr %l7                      ;\
 272  266          clr %o0; clr %o1; clr %o2; clr %o3                      ;\
 273  267          clr %o4; clr %o5; clr %o6; clr %o7                      ;\
 274  268          retry; .align 128
 275  269  
 276      -#if !defined(lint)
 277      -
 278  270  /*
 279  271   * If we get an unresolved tlb miss while in a window handler, the fault
 280  272   * handler will resume execution at the last instruction of the window
 281  273   * hander, instead of delivering the fault to the kernel.  Spill handlers
 282  274   * use this to spill windows into the wbuf.
 283  275   *
 284  276   * The mixed handler works by checking %sp, and branching to the correct
 285  277   * handler.  This is done by branching back to label 1: for 32b frames,
 286  278   * or label 2: for 64b frames; which implies the handler order is: 32b,
 287  279   * 64b, mixed.  The 1: and 2: labels are offset into the routines to
↓ open down ↓ 289 lines elided ↑ open up ↑
 577  569          ldxa    [%g5 + %g2]asi_num, %i5                         ;\
 578  570          ldxa    [%g5 + %g3]asi_num, %i6                         ;\
 579  571          ldxa    [%g5 + %g4]asi_num, %i7                         ;\
 580  572          restored                                                ;\
 581  573          retry                                                   ;\
 582  574          SKIP(31-25-TT_TRACE_L_INS)                              ;\
 583  575          ba,a,pt %xcc, fault_64bit_/**/tail                      ;\
 584  576          .empty
 585  577  
 586  578  
 587      -#endif /* !lint */
 588      -
 589  579  /*
 590  580   * SPILL_mixed spills either size window, depending on
 591  581   * whether %sp is even or odd, to a 32-bit address space.
 592  582   * This may only be used in conjunction with SPILL_32bit/
 593  583   * FILL_64bit.
 594  584   * Clear upper 32 bits of %sp if it is odd.
 595  585   * We won't need to clear them in 64 bit kernel.
 596  586   */
 597  587  #define SPILL_mixed                                             \
 598  588          btst    1, %sp                                          ;\
↓ open down ↓ 119 lines elided ↑ open up ↑
 718  708          ba,pt   %xcc,.fp_ieee_exception ;\
 719  709          nop                             ;\
 720  710          .align  32
 721  711  
 722  712  #define FP_TRAP                         \
 723  713          TT_TRACE(trace_gen)             ;\
 724  714          ba,pt   %xcc,.fp_exception      ;\
 725  715          nop                             ;\
 726  716          .align  32
 727  717  
 728      -#if !defined(lint)
 729      -
 730  718  /*
 731  719   * ECACHE_ECC error traps at level 0 and level 1
 732  720   */
 733  721  #define ECACHE_ECC(table_name)          \
 734  722          .global table_name              ;\
 735  723  table_name:                             ;\
 736  724          membar  #Sync                   ;\
 737  725          set     trap, %g1               ;\
 738  726          rdpr    %tt, %g3                ;\
 739  727          ba,pt   %xcc, sys_trap          ;\
 740  728          sub     %g0, 1, %g4             ;\
 741  729          .align  32
 742  730  
 743      -#endif /* !lint */
 744      -
 745  731  /*
 746  732   * illegal instruction trap
 747  733   */
 748  734  #define ILLTRAP_INSTR                     \
 749  735          membar  #Sync                     ;\
 750  736          TT_TRACE(trace_gen)               ;\
 751  737          or      %g0, P_UTRAP4, %g2        ;\
 752  738          or      %g0, T_UNIMP_INSTR, %g3   ;\
 753  739          sethi   %hi(.check_v9utrap), %g4  ;\
 754  740          jmp     %g4 + %lo(.check_v9utrap) ;\
↓ open down ↓ 325 lines elided ↑ open up ↑
1080 1066          cmp     %g6, T_INSTR_MMU_MISS                                   ;\
1081 1067          move    %xcc, MMFSA_I_CTX, %g1                                  ;\
1082 1068          ldx     [%g4 + %g1], %g1                                        ;\
1083 1069          stna    %g1, [%g3 + TRAP_ENT_TR]%asi                            ;\
1084 1070          TRACE_NEXT(%g3, %g4, %g6)
1085 1071  #else
1086 1072  #define TRACE_TSBHIT(ttextra)
1087 1073  #endif
1088 1074  
1089 1075  
1090      -#if defined(lint)
1091      -
1092      -struct scb      trap_table;
1093      -struct scb      scb;            /* trap_table/scb are the same object */
1094      -
1095      -#else /* lint */
1096      -
1097 1076  /*
1098 1077   * =======================================================================
1099 1078   *              SPARC V9 TRAP TABLE
1100 1079   *
1101 1080   * The trap table is divided into two halves: the first half is used when
1102 1081   * taking traps when TL=0; the second half is used when taking traps from
1103 1082   * TL>0. Note that handlers in the second half of the table might not be able
1104 1083   * to make the same assumptions as handlers in the first half of the table.
1105 1084   *
1106 1085   * Worst case trap nesting so far:
↓ open down ↓ 1783 lines elided ↑ open up ↑
2890 2869          ENTRY_NP(syscall_wrapper32)
2891 2870          BRAND_CALLBACK(BRAND_CB_SYSCALL32)
2892 2871          SYSCALL_NOTT(syscall_trap32)
2893 2872          SET_SIZE(syscall_wrapper32)
2894 2873  
2895 2874          ENTRY_NP(syscall_wrapper)
2896 2875          BRAND_CALLBACK(BRAND_CB_SYSCALL)
2897 2876          SYSCALL_NOTT(syscall_trap)
2898 2877          SET_SIZE(syscall_wrapper)
2899 2878  
2900      -#endif  /* lint */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX