Print this page
de-linting of .s files
m

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/io/acpica/osl_ml.s
          +++ new/usr/src/uts/intel/io/acpica/osl_ml.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 2008 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  
  29      -#if defined(lint) || defined(__lint)
  30      -#include <sys/types.h>
  31      -#include "acpi.h"
  32      -#endif  /* lint */
  33      -
  34   33  /*
  35   34   * Implementation as specific by ACPI 3.0 specification
  36   35   * section 5.2.10.1
  37   36   *
  38   37   * Global Lock Structure within the FACS 
  39   38   *
  40   39   * |-----------------------------------------------------------------------| 
  41   40   * |  Field  | Bit Length | Bit Offset |           Description             |
  42   41   * |---------|------------|------------|-----------------------------------| 
  43   42   * | Pending |     1      |     0      | Non-zero indicates that a request |
↓ open down ↓ 3 lines elided ↑ open up ↑
  47   46   * | Owned   |     1      |     1      | Non-zero indicates that the Global|
  48   47   * |         |            |            | lock is owned.                    |
  49   48   * |---------|------------|------------|-----------------------------------| 
  50   49   * | Reserved|     30     |     2      | Reserved for future use           |
  51   50   * |---------|------------|------------|-----------------------------------| 
  52   51   */
  53   52  
  54   53  /* Offset of GlobalLock element in FACS structure */
  55   54  #define GlobalLock      0x10
  56   55  
  57      -#if defined(lint) || defined(__lint)
  58      -
  59      -/* ARGSUSED */
  60      -UINT32
  61      -__acpi_acquire_global_lock(void *Facs)
  62      -{ return (0); }
  63      -
  64      -#else   /* lint */
  65      -
  66      -#if defined(__amd64)
  67   56          ENTRY(__acpi_acquire_global_lock)
  68   57          movq    $0xff, %rax             / error return if FACS is null
  69   58          orq     %rdi, %rdi              / %rdi contains pointer to FACS
  70   59          jz      1f
  71   60          leaq    GlobalLock(%rdi), %rdi  / make %rdi point at the lock
  72   61  0:
  73   62          movl    (%rdi), %eax            / get current value of Global Lock
  74   63          movl    %eax, %edx
  75   64          andl    $0xFFFFFFFE, %edx       / Clear pending bit
  76   65          btsl    $1, %edx                / Check and set owner bit
  77   66          adcl    $0, %edx                / If owned, set pending bit
  78   67          lock
  79   68          cmpxchgl %edx, (%rdi)           / Attempt to set new value
  80   69          jnz     0b                      / If not set, try again
  81   70          cmpb    $3, %dl                 / Was it acquired or marked pending?
  82   71          sbbq    %rax, %rax              / acquired = -1, pending = 0
  83   72  1:
  84   73          ret
  85   74          SET_SIZE(__acpi_acquire_global_lock)
  86   75  
  87      -#elif defined(__i386)
  88   76  
  89      -        ENTRY(__acpi_acquire_global_lock)
  90      -        movl    $0xff, %eax             / error return if FACS is null
  91      -        movl    4(%esp), %ecx           / %ecx contains pointer to FACS
  92      -        orl     %ecx, %ecx
  93      -        jz      1f
  94      -        leal    GlobalLock(%ecx), %ecx  / make %ecx point at the lock
  95      -0:
  96      -        movl    (%ecx), %eax
  97      -        movl    %eax, %edx
  98      -        andl    $0xFFFFFFFE, %edx
  99      -        btsl    $1, %edx
 100      -        adcl    $0, %edx
 101      -        lock
 102      -        cmpxchgl %edx, (%ecx)
 103      -        jnz     0b
 104      -        cmpb    $3, %dl
 105      -        sbbl    %eax, %eax
 106      -1:
 107      -        ret
 108      -        SET_SIZE(__acpi_acquire_global_lock)
 109      -
 110      -#endif  /* i386 */
 111      -
 112      -#endif  /* lint */
 113      -
 114      -
 115      -#if defined(lint) || defined(__lint)
 116      -
 117      -/* ARGSUSED */
 118      -UINT32
 119      -__acpi_release_global_lock(void *Facs)
 120      -{ return (0); }
 121      -
 122      -#else   /* lint */
 123      -
 124      -#if defined(__amd64)
 125   77          ENTRY(__acpi_release_global_lock)
 126   78          xorq    %rax, %rax      / error return if FACS is null
 127   79          orq     %rdi, %rdi      / %rdi contains pointer to FACS
 128   80          jz      1f
 129   81          leaq    GlobalLock(%rdi), %rdi  / make %rdi point at the lock
 130   82  0:
 131   83          movl    (%rdi), %eax
 132   84          movl    %eax, %edx
 133   85          andl    $0xFFFFFFFC, %edx
 134   86          lock
 135   87          cmpxchgl %edx, (%rdi)
 136   88          jnz     0b
 137   89          andq    $1, %rax
 138   90  1:
 139   91          ret
 140   92          SET_SIZE(__acpi_release_global_lock)
 141   93  
 142      -#elif defined(__i386)
 143   94  
 144      -        ENTRY(__acpi_release_global_lock)
 145      -        xorl    %eax, %eax              / error return if FACS is null
 146      -        movl    4(%esp), %ecx           / %ecx contains pointer to FACS
 147      -        orl     %ecx, %ecx
 148      -        jz      1f
 149      -        leal    GlobalLock(%ecx), %ecx  / make %ecx point at the lock
 150      -0:
 151      -        movl    (%ecx), %eax
 152      -        movl    %eax, %edx
 153      -        andl    $0xFFFFFFFC, %edx
 154      -        lock
 155      -        cmpxchgl %edx, (%ecx)
 156      -        jnz     0b
 157      -        andl    $1, %eax
 158      -1:
 159      -        ret
 160      -        SET_SIZE(__acpi_release_global_lock)
 161      -
 162      -#endif  /* i386 */
 163      -
 164      -#endif  /* lint */
 165      -
 166      -
 167   95  /*
 168   96   * execute WBINVD instruction
 169   97   */
 170   98  
 171      -#if defined(lint) || defined(__lint)
 172      -
 173      -/* ARGSUSED */
 174      -void
 175      -__acpi_wbinvd(void)
 176      -{ }
 177      -
 178      -#else   /* lint */
 179      -
 180   99          ENTRY(__acpi_wbinvd)
 181  100          wbinvd
 182  101          ret
 183  102          SET_SIZE(__acpi_wbinvd)
 184      -
 185      -#endif  /* lint */
 186  103  
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX