Print this page
5007142 Add ntohll and htonll to sys/byteorder.h
6717509 Need to use bswap/bswapq for byte swap of 64-bit integer on x32/x64
PSARC 2008/474

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/ia32/ml/ia32.il
          +++ new/usr/src/uts/intel/ia32/ml/ia32.il
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  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  /*
  23      - * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
       23 + * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  28      -
  29   27  /
  30   28  / Inline functions for i386 kernels.
  31   29  /       Shared between all x86 platform variants.
  32   30  /
  33   31  
  34   32  /
  35   33  / return current thread pointer
  36   34  /
  37   35  / NOTE: the "0x10" should be replaced by the computed value of the
  38   36  /       offset of "cpu_thread" from the beginning of the struct cpu.
↓ open down ↓ 42 lines elided ↑ open up ↑
  81   79  /
  82   80          .inline highbit,4
  83   81          movl    $-1, %eax
  84   82          bsrl    (%esp), %eax
  85   83          incl    %eax
  86   84          .end
  87   85  
  88   86  /
  89   87  / Networking byte order functions (too bad, Intel has the wrong byte order)
  90   88  /
       89 +        .inline htonll,4
       90 +        movl    (%esp), %edx
       91 +        movl    4(%esp), %eax
       92 +        bswap   %edx
       93 +        bswap   %eax
       94 +        .end
       95 +
       96 +        .inline ntohll,4
       97 +        movl    (%esp), %edx
       98 +        movl    4(%esp), %eax
       99 +        bswap   %edx
      100 +        bswap   %eax
      101 +        .end
      102 +
  91  103          .inline htonl,4
  92  104          movl    (%esp), %eax
  93  105          bswap   %eax
  94  106          .end
  95  107  
  96  108          .inline ntohl,4
  97  109          movl    (%esp), %eax
  98  110          bswap   %eax
  99  111          .end
 100  112  
↓ open down ↓ 74 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX