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/amd64/ml/amd64.il
          +++ new/usr/src/uts/intel/amd64/ml/amd64.il
↓ open down ↓ 11 lines elided ↑ open up ↑
  12   12   *
  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      - * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
       22 + * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25  
  26      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  27      -
  28   26  /
  29   27  / In-line functions for amd64 kernels.
  30   28  /
  31   29  
  32   30  /
  33   31  / return current thread pointer
  34   32  /
  35   33  / NOTE: the "0x18" should be replaced by the computed value of the
  36   34  /       offset of "cpu_thread" from the beginning of the struct cpu.
  37   35  /       Including "assym.h" does not work, however, since that stuff
↓ open down ↓ 33 lines elided ↑ open up ↑
  71   69          .inline lowbit,4
  72   70          movq    $-1, %rax
  73   71          bsfq    %rdi, %rax
  74   72          incq    %rax
  75   73          .end
  76   74  
  77   75  /
  78   76  / Networking byte order functions (too bad, Intel has the wrong byte order)
  79   77  /
  80   78  
       79 +        .inline htonll,4
       80 +        movq    %rdi, %rax
       81 +        bswapq  %rax
       82 +        .end
       83 +
       84 +        .inline ntohll,4
       85 +        movq    %rdi, %rax
       86 +        bswapq  %rax
       87 +        .end
       88 +
  81   89          .inline htonl,4
  82   90          movl    %edi, %eax
  83   91          bswap   %eax
  84   92          .end
  85   93  
  86   94          .inline ntohl,4
  87   95          movl    %edi, %eax
  88   96          bswap   %eax
  89   97          .end
  90   98  
↓ open down ↓ 109 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX