The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/openzfs/include/os/linux/spl/sys/isa_defs.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  *  Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
    3  *  Copyright (C) 2007 The Regents of the University of California.
    4  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
    5  *  Written by Brian Behlendorf <behlendorf1@llnl.gov>.
    6  *  UCRL-CODE-235197
    7  *
    8  *  This file is part of the SPL, Solaris Porting Layer.
    9  *
   10  *  The SPL is free software; you can redistribute it and/or modify it
   11  *  under the terms of the GNU General Public License as published by the
   12  *  Free Software Foundation; either version 2 of the License, or (at your
   13  *  option) any later version.
   14  *
   15  *  The SPL is distributed in the hope that it will be useful, but WITHOUT
   16  *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   17  *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   18  *  for more details.
   19  *
   20  *  You should have received a copy of the GNU General Public License along
   21  *  with the SPL.  If not, see <http://www.gnu.org/licenses/>.
   22  */
   23 
   24 #ifndef _SPL_ISA_DEFS_H
   25 #define _SPL_ISA_DEFS_H
   26 
   27 /* x86_64 arch specific defines */
   28 #if defined(__x86_64) || defined(__x86_64__)
   29 
   30 #if !defined(__x86_64)
   31 #define __x86_64
   32 #endif
   33 
   34 #if !defined(__amd64)
   35 #define __amd64
   36 #endif
   37 
   38 #if !defined(__x86)
   39 #define __x86
   40 #endif
   41 
   42 #if defined(_ILP32)
   43 /* x32-specific defines; careful to *not* define _LP64 here */
   44 #else
   45 #if !defined(_LP64)
   46 #define _LP64
   47 #endif
   48 #endif
   49 
   50 /* i386 arch specific defines */
   51 #elif defined(__i386) || defined(__i386__)
   52 
   53 #if !defined(__i386)
   54 #define __i386
   55 #endif
   56 
   57 #if !defined(__x86)
   58 #define __x86
   59 #endif
   60 
   61 #if !defined(_ILP32)
   62 #define _ILP32
   63 #endif
   64 
   65 /* powerpc (ppc64) arch specific defines */
   66 #elif defined(__powerpc) || defined(__powerpc__) || defined(__powerpc64__)
   67 
   68 #if !defined(__powerpc)
   69 #define __powerpc
   70 #endif
   71 
   72 #if !defined(__powerpc__)
   73 #define __powerpc__
   74 #endif
   75 
   76 #if defined(__powerpc64__)
   77 #if !defined(_LP64)
   78 #define _LP64
   79 #endif
   80 #else
   81 #if !defined(_ILP32)
   82 #define _ILP32
   83 #endif
   84 #endif
   85 
   86 /* arm arch specific defines */
   87 #elif defined(__arm) || defined(__arm__)
   88 
   89 #if !defined(__arm)
   90 #define __arm
   91 #endif
   92 
   93 #if !defined(__arm__)
   94 #define __arm__
   95 #endif
   96 
   97 #if !defined(_ILP32)
   98 #define _ILP32
   99 #endif
  100 
  101 #if defined(__ARMEL__)
  102 #define _ZFS_LITTLE_ENDIAN
  103 #else
  104 #define _ZFS_BIG_ENDIAN
  105 #endif
  106 
  107 /* aarch64 arch specific defines */
  108 #elif defined(__aarch64__)
  109 
  110 #if !defined(_LP64)
  111 #define _LP64
  112 #endif
  113 
  114 #if defined(__AARCH64EL__)
  115 #define _ZFS_LITTLE_ENDIAN
  116 #else
  117 #define _ZFS_BIG_ENDIAN
  118 #endif
  119 
  120 /* sparc arch specific defines */
  121 #elif defined(__sparc) || defined(__sparc__)
  122 
  123 #if !defined(__sparc)
  124 #define __sparc
  125 #endif
  126 
  127 #if !defined(__sparc__)
  128 #define __sparc__
  129 #endif
  130 
  131 #if defined(__arch64__)
  132 #if !defined(_LP64)
  133 #define _LP64
  134 #endif
  135 #else
  136 #if !defined(_ILP32)
  137 #define _ILP32
  138 #endif
  139 #endif
  140 
  141 #define _ZFS_BIG_ENDIAN
  142 #define _SUNOS_VTOC_16
  143 
  144 /* s390 arch specific defines */
  145 #elif defined(__s390__)
  146 #if defined(__s390x__)
  147 #if !defined(_LP64)
  148 #define _LP64
  149 #endif
  150 #else
  151 #if !defined(_ILP32)
  152 #define _ILP32
  153 #endif
  154 #endif
  155 
  156 #define _ZFS_BIG_ENDIAN
  157 
  158 /* MIPS arch specific defines */
  159 #elif defined(__mips__)
  160 
  161 #if defined(__MIPSEB__)
  162 #define _ZFS_BIG_ENDIAN
  163 #elif defined(__MIPSEL__)
  164 #define _ZFS_LITTLE_ENDIAN
  165 #else
  166 #error MIPS no endian specified
  167 #endif
  168 
  169 #ifndef _LP64
  170 #define _ILP32
  171 #endif
  172 
  173 #define _SUNOS_VTOC_16
  174 
  175 /*
  176  * RISC-V arch specific defines
  177  * only RV64G (including atomic) LP64 is supported yet
  178  */
  179 #elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64 && \
  180         defined(__riscv_atomic) && __riscv_atomic
  181 
  182 #if !defined(_LP64)
  183 #define _LP64 1
  184 #endif
  185 
  186 #ifndef __riscv__
  187 #define __riscv__
  188 #endif
  189 
  190 #ifndef __rv64g__
  191 #define __rv64g__
  192 #endif
  193 
  194 #define _ZFS_LITTLE_ENDIAN
  195 
  196 #define _SUNOS_VTOC_16
  197 
  198 #else
  199 /*
  200  * Currently supported:
  201  * x86_64, x32, i386, arm, powerpc, s390, sparc, mips, and RV64G
  202  */
  203 #error "Unsupported ISA type"
  204 #endif
  205 
  206 #if defined(_ILP32) && defined(_LP64)
  207 #error "Both _ILP32 and _LP64 are defined"
  208 #endif
  209 
  210 #if !defined(_ILP32) && !defined(_LP64)
  211 #error "Neither _ILP32 or _LP64 are defined"
  212 #endif
  213 
  214 #include <sys/byteorder.h>
  215 
  216 /*
  217  * CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS will be defined by the Linux
  218  * kernel for architectures which support efficient unaligned access.
  219  */
  220 #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
  221 #define HAVE_EFFICIENT_UNALIGNED_ACCESS
  222 #endif
  223 
  224 #if defined(_ZFS_LITTLE_ENDIAN) && defined(_ZFS_BIG_ENDIAN)
  225 #error "Both _ZFS_LITTLE_ENDIAN and _ZFS_BIG_ENDIAN are defined"
  226 #endif
  227 
  228 #if !defined(_ZFS_LITTLE_ENDIAN) && !defined(_ZFS_BIG_ENDIAN)
  229 #error "Neither _ZFS_LITTLE_ENDIAN or _ZFS_BIG_ENDIAN are defined"
  230 #endif
  231 
  232 #endif  /* _SPL_ISA_DEFS_H */

Cache object: 70258c6cf8e59f86cb958f8698000b31


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.