Print this page
de-linting of .s files
first

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/ia32/ml/desctbls_asm.s
          +++ new/usr/src/uts/intel/ia32/ml/desctbls_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 +/*
       27 + * Copyright 2019 Joyent, Inc.
       28 + */
       29 +
  26   30  #include <sys/asm_linkage.h>
  27   31  #include <sys/asm_misc.h>
  28   32  #include <sys/regset.h>
  29   33  #include <sys/panic.h>
  30   34  #include <sys/ontrap.h>
  31   35  #include <sys/privregs.h>
  32   36  #include <sys/segments.h>
  33   37  #include <sys/trap.h>
  34   38  
  35      -#if defined(__lint)
  36      -#include <sys/types.h>
  37      -#include <sys/systm.h>
  38      -#include <sys/thread.h>
  39      -#include <sys/archsystm.h>
  40      -#include <sys/byteorder.h>
  41      -#include <sys/dtrace.h>
  42      -#include <sys/x86_archext.h>
  43      -#else   /* __lint */
  44   39  #include "assym.h"
  45      -#endif  /* __lint */
  46   40  
  47      -#if defined(__lint)
  48      -
  49      -/*ARGSUSED*/
  50      -void
  51      -rd_idtr(desctbr_t *idtr)
  52      -{}
  53      -
  54      -/*ARGSUSED*/
  55      -void
  56      -wr_idtr(desctbr_t *idtr)
  57      -{}
  58      -
  59      -#else   /* __lint */
  60      -
  61      -#if defined(__amd64)
  62      -
  63   41          ENTRY_NP(rd_idtr)
  64   42          sidt    (%rdi)
  65   43          ret
  66   44          SET_SIZE(rd_idtr)
  67   45  
  68   46          ENTRY_NP(wr_idtr)
  69   47          lidt    (%rdi)
  70   48          ret
  71   49          SET_SIZE(wr_idtr)
  72   50  
  73      -#elif defined(__i386)
  74      -
  75      -        ENTRY_NP(rd_idtr)
  76      -        pushl   %ebp
  77      -        movl    %esp, %ebp
  78      -        movl    8(%ebp), %edx
  79      -        sidt    (%edx)
  80      -        leave
  81      -        ret
  82      -        SET_SIZE(rd_idtr)
  83      -
  84      -        ENTRY_NP(wr_idtr)
  85      -        pushl   %ebp
  86      -        movl    %esp, %ebp
  87      -        movl    8(%ebp), %edx
  88      -        lidt    (%edx)
  89      -        leave
  90      -        ret
  91      -        SET_SIZE(wr_idtr)
  92      -
  93      -#endif  /* __i386 */
  94      -#endif  /* __lint */
  95      -
  96      -#if defined(__lint)
  97      -
  98      -/*ARGSUSED*/
  99      -void
 100      -rd_gdtr(desctbr_t *gdtr)
 101      -{}
 102      -
 103      -/*ARGSUSED*/
 104      -void
 105      -wr_gdtr(desctbr_t *gdtr)
 106      -{}
 107      -
 108      -#else   /* __lint */
 109      -
 110      -#if defined(__amd64)
 111      -
 112   51          ENTRY_NP(rd_gdtr)
 113   52          pushq   %rbp
 114   53          movq    %rsp, %rbp
 115   54          sgdt    (%rdi)
 116   55          leave
 117   56          ret
 118   57          SET_SIZE(rd_gdtr)
 119   58  
 120   59          ENTRY_NP(wr_gdtr)
 121   60          pushq   %rbp
 122   61          movq    %rsp, %rbp
 123   62          lgdt    (%rdi)
 124   63          jmp     1f
 125   64          nop
 126   65  1:
 127   66          leave
 128   67          ret
 129   68          SET_SIZE(wr_gdtr)
 130   69  
 131      -#elif defined(__i386)
 132      -
 133      -        ENTRY_NP(rd_gdtr)
 134      -        pushl   %ebp
 135      -        movl    %esp, %ebp
 136      -        movl    8(%ebp), %edx
 137      -        sgdt    (%edx)
 138      -        leave
 139      -        ret
 140      -        SET_SIZE(rd_gdtr)
 141      -
 142      -        ENTRY_NP(wr_gdtr)
 143      -        pushl   %ebp
 144      -        movl    %esp, %ebp
 145      -        movl    8(%ebp), %edx
 146      -        lgdt    (%edx)
 147      -        jmp     1f
 148      -        nop
 149      -1:
 150      -        leave
 151      -        ret
 152      -        SET_SIZE(wr_gdtr)
 153      -
 154      -#endif  /* __i386 */
 155      -#endif  /* __lint */
 156      -
 157      -#if defined(__amd64)
 158      -#if defined(__lint)
 159      -
 160      -/*ARGSUSED*/
 161      -void
 162      -load_segment_registers(selector_t cs, selector_t fs, selector_t gs,
 163      -    selector_t ss)
 164      -{}
 165      -
 166      -selector_t
 167      -get_cs_register()
 168      -{ return (0); }
 169      -
 170      -#else   /* __lint */
 171      -
 172   70          /*
 173   71           * loads zero selector for ds and es.
 174   72           */
 175   73          ENTRY_NP(load_segment_registers)
 176   74          pushq   %rbp
 177   75          movq    %rsp, %rbp
 178   76          pushq   %rdi
 179   77          pushq   $.newcs
 180   78          lretq
 181   79  .newcs:
↓ open down ↓ 11 lines elided ↑ open up ↑
 193   91          movw    %ax, %ss
 194   92          leave
 195   93          ret
 196   94          SET_SIZE(load_segment_registers)
 197   95  
 198   96          ENTRY_NP(get_cs_register)
 199   97          movq    %cs, %rax
 200   98          ret
 201   99          SET_SIZE(get_cs_register)
 202  100  
 203      -#endif  /* __lint */
 204      -#elif defined(__i386)
 205      -
 206      -#if defined(__lint)
 207      -
 208      -/*ARGSUSED*/
 209      -void
 210      -load_segment_registers(
 211      -    selector_t cs, selector_t ds, selector_t es,
 212      -    selector_t fs, selector_t gs, selector_t ss)
 213      -{}
 214      -
 215      -selector_t
 216      -get_cs_register()
 217      -{ return ((selector_t) 0); }
 218      -
 219      -#else   /* __lint */
 220      -
 221      -        ENTRY_NP(load_segment_registers)
 222      -        pushl   %ebp
 223      -        movl    %esp, %ebp
 224      -
 225      -        pushl   0x8(%ebp)
 226      -        pushl   $.newcs
 227      -        lret
 228      -.newcs:
 229      -        movw    0xc(%ebp), %ax
 230      -        movw    %ax, %ds
 231      -        movw    0x10(%ebp), %ax
 232      -        movw    %ax, %es
 233      -        movw    0x14(%ebp), %ax
 234      -        movw    %ax, %fs
 235      -        movw    0x18(%ebp), %ax
 236      -        movw    %ax, %gs
 237      -        movw    0x1c(%ebp), %ax
 238      -        movw    %ax, %ss
 239      -        leave
 240      -        ret
 241      -        SET_SIZE(load_segment_registers)
 242      -
 243      -        ENTRY_NP(get_cs_register)
 244      -        movl    $0, %eax
 245      -        movw    %cs, %ax
 246      -        ret
 247      -        SET_SIZE(get_cs_register)
 248      -
 249      -#endif  /* __lint */
 250      -#endif  /* __i386 */
 251      -
 252      -#if defined(__lint)
 253      -
 254      -/*ARGSUSED*/
 255      -void
 256      -wr_ldtr(selector_t ldtsel)
 257      -{}
 258      -
 259      -selector_t
 260      -rd_ldtr(void)
 261      -{ return (0); }
 262      -
 263      -#else   /* __lint */
 264      -
 265      -#if defined(__amd64)
 266      -
 267  101          ENTRY_NP(wr_ldtr)
 268  102          movq    %rdi, %rax
 269  103          lldt    %ax
 270  104          ret
 271  105          SET_SIZE(wr_ldtr)
 272  106  
 273  107          ENTRY_NP(rd_ldtr)
 274  108          xorl    %eax, %eax
 275  109          sldt    %ax
 276  110          ret
 277  111          SET_SIZE(rd_ldtr)
 278  112  
 279      -#elif defined(__i386)
 280      -
 281      -        ENTRY_NP(wr_ldtr)
 282      -        movw    4(%esp), %ax
 283      -        lldt    %ax
 284      -        ret
 285      -        SET_SIZE(wr_ldtr)
 286      -
 287      -        ENTRY_NP(rd_ldtr)
 288      -        xorl    %eax, %eax
 289      -        sldt    %ax
 290      -        ret
 291      -        SET_SIZE(rd_ldtr)
 292      -
 293      -#endif  /* __i386 */
 294      -#endif  /* __lint */
 295      -
 296      -#if defined(__lint)
 297      -
 298      -/*ARGSUSED*/
 299      -void
 300      -wr_tsr(selector_t tsssel)
 301      -{}
 302      -
 303      -#else   /* __lint */
 304      -
 305      -#if defined(__amd64)
 306      -
 307  113          ENTRY_NP(wr_tsr)
 308  114          movq    %rdi, %rax
 309  115          ltr     %ax
 310  116          ret
 311  117          SET_SIZE(wr_tsr)
 312  118  
 313      -#elif defined(__i386)
 314      -
 315      -        ENTRY_NP(wr_tsr)
 316      -        movw    4(%esp), %ax
 317      -        ltr     %ax
 318      -        ret
 319      -        SET_SIZE(wr_tsr)
 320      -
 321      -#endif  /* __i386 */
 322      -#endif  /* __lint */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX