Print this page
de-linting of .s files
m

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/ml/interrupt.s
          +++ new/usr/src/uts/i86pc/ml/interrupt.s
↓ open down ↓ 28 lines elided ↑ open up ↑
  29   29  
  30   30  /*      Copyright (c) 1987, 1988 Microsoft Corporation          */
  31   31  /*        All Rights Reserved                                   */
  32   32  
  33   33  #include <sys/asm_linkage.h>
  34   34  #include <sys/asm_misc.h>
  35   35  #include <sys/regset.h>
  36   36  #include <sys/psw.h>
  37   37  #include <sys/x86_archext.h>
  38   38  
  39      -#if defined(__lint)
  40      -
  41      -#include <sys/types.h>
  42      -#include <sys/thread.h>
  43      -#include <sys/systm.h>
  44      -
  45      -#else   /* __lint */
  46      -
  47   39  #include <sys/segments.h>
  48   40  #include <sys/pcb.h>
  49   41  #include <sys/trap.h>
  50   42  #include <sys/ftrace.h>
  51   43  #include <sys/traptrace.h>
  52   44  #include <sys/clock.h>
  53   45  #include <sys/panic.h>
  54   46  #include "assym.h"
  55   47  
  56      -#endif  /* lint */
  57      -
  58      -#if defined(__lint)
  59      -
  60      -void
  61      -_interrupt(void)
  62      -{}
  63      -
  64      -#else   /* __lint */
  65      -
  66      -#if defined(__amd64)
  67      -
  68   48          /*
  69   49           * Common register usage:
  70   50           *
  71   51           * %r12         trap trace pointer
  72   52           */
  73   53          ENTRY_NP2(cmnint, _interrupt)
  74   54  
  75   55          INTR_PUSH
  76   56          INTGATE_INIT_KERNEL_FLAGS       /* (set kernel rflags values) */
  77   57  
↓ open down ↓ 24 lines elided ↑ open up ↑
 102   82          movq    %rsp, %rdi              /* pass struct regs pointer */
 103   83          movq    do_interrupt_common, %rax
 104   84          INDIRECT_CALL_REG(rax)
 105   85  
 106   86          jmp     _sys_rtt_ints_disabled
 107   87          /*NOTREACHED*/
 108   88  
 109   89          SET_SIZE(cmnint)
 110   90          SET_SIZE(_interrupt)
 111   91  
 112      -#elif defined(__i386)
 113      -
 114      -        ENTRY_NP2(cmnint, _interrupt)
 115      -
 116      -        INTR_PUSH
 117      -        INTGATE_INIT_KERNEL_FLAGS
 118      -
 119      -        /*
 120      -         * At the end of TRACE_PTR %esi points to the current TRAPTRACE entry
 121      -         */
 122      -        TRACE_PTR(%esi, %eax, %eax, %edx, $TT_INTERRUPT)
 123      -                                                /* Uses labels 8 and 9 */
 124      -        TRACE_REGS(%esi, %esp, %eax, %ebx)      /* Uses label 9 */
 125      -        TRACE_STAMP(%esi)               /* Clobbers %eax, %edx, uses 9 */
 126      -
 127      -        movl    %esp, %ebp
 128      -
 129      -        TRACE_STACK(%esi)
 130      -
 131      -        pushl   %esi                    /* pass traptrace record pointer */
 132      -        pushl   %ebp                    /* pass struct regs pointer */
 133      -        call    *do_interrupt_common    /* interrupt service routine */
 134      -        addl    $8, %esp                /* pop args off of stack */
 135      -
 136      -        jmp     _sys_rtt_ints_disabled
 137      -        /*NOTREACHED*/
 138      -
 139      -        SET_SIZE(cmnint)
 140      -        SET_SIZE(_interrupt)
 141      -
 142      -#endif  /* __i386 */
 143      -
 144   92  /*
 145   93   * Declare a uintptr_t which has the size of _interrupt to enable stack
 146   94   * traceback code to know when a regs structure is on the stack.
 147   95   */
 148   96          .globl  _interrupt_size
 149   97          .align  CLONGSIZE
 150   98  _interrupt_size:
 151   99          .NWORD  . - _interrupt
 152  100          .type   _interrupt_size, @object
 153  101  
 154      -#endif  /* __lint */
 155      -
 156      -#if defined(__lint)
 157      -
 158      -void
 159      -fakesoftint(void)
 160      -{}
 161      -
 162      -#else   /* __lint */
 163      -
 164      -        /
 165      -        / If we're here, we're being called from splx() to fake a soft
 166      -        / interrupt (note that interrupts are still disabled from splx()).
 167      -        / We execute this code when a soft interrupt is posted at
 168      -        / level higher than the CPU's current spl; when spl is lowered in
 169      -        / splx(), it will see the softint and jump here.  We'll do exactly
 170      -        / what a trap would do:  push our flags, %cs, %eip, error code
 171      -        / and trap number (T_SOFTINT).  The cmnint() code will see T_SOFTINT
 172      -        / and branch to the dosoftint() code.
 173      -        /
 174      -#if defined(__amd64)
 175      -
 176  102          /*
 177      -         * In 64-bit mode, iretq -always- pops all five regs
 178      -         * Imitate the 16-byte auto-align of the stack, and the
 179      -         * zero-ed out %ss value.
      103 +         * If we're here, we're being called from splx() to fake a soft
      104 +         * interrupt (note that interrupts are still disabled from
      105 +         * splx()).  We execute this code when a soft interrupt is
      106 +         * posted at level higher than the CPU's current spl; when spl
      107 +         * is lowered in splx(), it will see the softint and jump here.
      108 +         * We'll do exactly what a trap would do:  push our flags, %cs,
      109 +         * %rip, error code and trap number (T_SOFTINT).  The cmnint()
      110 +         * code will see T_SOFTINT and branch to the dosoftint() code.
      111 +         *
      112 +         * iretq -always- pops all five regs. Imitate the 16-byte
      113 +         * auto-align of the stack, and the zero-ed out %ss value.
 180  114           */
      115 +
 181  116          ENTRY_NP(fakesoftint)
 182  117          movq    %rsp, %r11
 183  118          andq    $-16, %rsp
 184  119          pushq   $KDS_SEL        /* %ss */
 185  120          pushq   %r11            /* %rsp */
 186  121          pushf                   /* rflags */
 187  122  #if defined(__xpv)
 188  123          popq    %r11
 189  124          EVENT_MASK_TO_IE(%rdi, %r11)
 190  125          pushq   %r11
↓ open down ↓ 2 lines elided ↑ open up ↑
 193  128          leaq    fakesoftint_return(%rip), %r11
 194  129          pushq   %r11            /* %rip */
 195  130          pushq   $0              /* err */
 196  131          pushq   $T_SOFTINT      /* trap */
 197  132          jmp     cmnint
 198  133          ALTENTRY(fakesoftint_return)
 199  134          ret
 200  135          SET_SIZE(fakesoftint_return)
 201  136          SET_SIZE(fakesoftint)
 202  137  
 203      -#elif defined(__i386)
 204      -
 205      -        ENTRY_NP(fakesoftint)
 206      -        pushfl
 207      -#if defined(__xpv)
 208      -        popl    %eax
 209      -        EVENT_MASK_TO_IE(%edx, %eax)
 210      -        pushl   %eax
 211      -#endif
 212      -        pushl   %cs
 213      -        pushl   $fakesoftint_return
 214      -        pushl   $0
 215      -        pushl   $T_SOFTINT
 216      -        jmp     cmnint
 217      -        ALTENTRY(fakesoftint_return)
 218      -        ret
 219      -        SET_SIZE(fakesoftint_return)
 220      -        SET_SIZE(fakesoftint)
 221      -
 222      -#endif  /* __i386 */
 223      -#endif  /* __lint */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX