]> git.proxmox.com Git - mirror_spl.git/blame - include/sys/isa_defs.h
Remove sysevents
[mirror_spl.git] / include / sys / isa_defs.h
CommitLineData
4b393c50 1/*
716154c5
BB
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.
3d6af2dd 9 * For details, see <http://zfsonlinux.org/>.
716154c5
BB
10 *
11 * The SPL is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 *
16 * The SPL is distributed in the hope that it will be useful, but WITHOUT
17 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 * for more details.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with the SPL. If not, see <http://www.gnu.org/licenses/>.
4b393c50 23 */
716154c5 24
4a4295b2 25#ifndef _SPL_ISA_DEFS_H
26#define _SPL_ISA_DEFS_H
dbb484ec 27
6a585c61 28/* x86_64 arch specific defines */
29#if defined(__x86_64) || defined(__x86_64__)
30
31#if !defined(__x86_64)
5461eefe 32#define __x86_64
6a585c61 33#endif
34
35#if !defined(__amd64)
5461eefe 36#define __amd64
6a585c61 37#endif
38
39#if !defined(__x86)
5461eefe 40#define __x86
6a585c61 41#endif
42
43#if !defined(_LP64)
5461eefe 44#define _LP64
6a585c61 45#endif
46
5461eefe 47#define _ALIGNMENT_REQUIRED 1
5ad98ad0
TH
48
49
6a585c61 50/* i386 arch specific defines */
51#elif defined(__i386) || defined(__i386__)
52
53#if !defined(__i386)
5461eefe 54#define __i386
6a585c61 55#endif
56
57#if !defined(__x86)
5461eefe 58#define __x86
6a585c61 59#endif
60
61#if !defined(_ILP32)
5461eefe 62#define _ILP32
6a585c61 63#endif
64
5461eefe 65#define _ALIGNMENT_REQUIRED 0
5ad98ad0 66
37319315 67/* powerpc (ppc64) arch specific defines */
225c1106 68#elif defined(__powerpc) || defined(__powerpc__) || defined(__powerpc64__)
37319315
BB
69
70#if !defined(__powerpc)
5461eefe 71#define __powerpc
37319315
BB
72#endif
73
74#if !defined(__powerpc__)
5461eefe 75#define __powerpc__
37319315
BB
76#endif
77
225c1106 78#if defined(__powerpc64__)
37319315 79#if !defined(_LP64)
5461eefe 80#define _LP64
37319315 81#endif
225c1106
BB
82#else
83#if !defined(_ILP32)
5461eefe 84#define _ILP32
225c1106
BB
85#endif
86#endif
37319315 87
5ad98ad0
TH
88/*
89 * Illumos doesn't define _ALIGNMENT_REQUIRED for PPC, so default to 1
90 * out of paranoia.
91 */
5461eefe 92#define _ALIGNMENT_REQUIRED 1
5ad98ad0 93
cb75844e 94/* arm arch specific defines */
d6e6e4a9 95#elif defined(__arm) || defined(__arm__) || defined(__aarch64__)
cb75844e
JL
96
97#if !defined(__arm)
5461eefe 98#define __arm
cb75844e
JL
99#endif
100
101#if !defined(__arm__)
5461eefe 102#define __arm__
cb75844e
JL
103#endif
104
225c1106
BB
105#if defined(__aarch64__)
106#if !defined(_LP64)
5461eefe 107#define _LP64
225c1106
BB
108#endif
109#else
110#if !defined(_ILP32)
5461eefe 111#define _ILP32
225c1106
BB
112#endif
113#endif
114
d6e6e4a9 115#if defined(__ARMEL__) || defined(__AARCH64EL__)
5461eefe 116#define _LITTLE_ENDIAN
cb75844e 117#else
5461eefe 118#define _BIG_ENDIAN
cb75844e
JL
119#endif
120
5ad98ad0
TH
121/*
122 * Illumos doesn't define _ALIGNMENT_REQUIRED for ARM, so default to 1
123 * out of paranoia.
124 */
5461eefe 125#define _ALIGNMENT_REQUIRED 1
5ad98ad0 126
d58a99af 127/* sparc arch specific defines */
128#elif defined(__sparc) || defined(__sparc__)
129
130#if !defined(__sparc)
5461eefe 131#define __sparc
d58a99af 132#endif
133
134#if !defined(__sparc__)
5461eefe 135#define __sparc__
d58a99af 136#endif
137
225c1106
BB
138#if defined(__arch64__)
139#if !defined(_LP64)
5461eefe 140#define _LP64
225c1106
BB
141#endif
142#else
143#if !defined(_ILP32)
5461eefe 144#define _ILP32
225c1106 145#endif
d58a99af 146#endif
147
5461eefe
BB
148#define _BIG_ENDIAN
149#define _SUNOS_VTOC_16
150#define _ALIGNMENT_REQUIRED 1
d58a99af 151
224817e2
DJL
152/* s390 arch specific defines */
153#elif defined(__s390__)
154#if defined(__s390x__)
155#if !defined(_LP64)
156#define _LP64
157#endif
158#else
159#if !defined(_ILP32)
160#define _ILP32
161#endif
162#endif
163
164#define _BIG_ENDIAN
165
5ad98ad0
TH
166/*
167 * Illumos doesn't define _ALIGNMENT_REQUIRED for s390, so default to 1
168 * out of paranoia.
169 */
5461eefe 170#define _ALIGNMENT_REQUIRED 1
5ad98ad0 171
c60a51b6
YS
172/* MIPS arch specific defines */
173#elif defined(__mips__)
174
175#if defined(__MIPSEB__)
176#define _BIG_ENDIAN
177#elif defined(__MIPSEL__)
178#define _LITTLE_ENDIAN
179#else
180#error MIPS no endian specified
181#endif
182
183#ifndef _LP64
184#define _ILP32
185#endif
186
187#define _SUNOS_VTOC_16
188
5ad98ad0
TH
189/*
190 * Illumos doesn't define _ALIGNMENT_REQUIRED for MIPS, so default to 1
191 * out of paranoia.
192 */
5461eefe 193#define _ALIGNMENT_REQUIRED 1
5ad98ad0 194
c60a51b6
YS
195#else
196/*
197 * Currently supported:
198 * x86_64, i386, arm, powerpc, s390, sparc, and mips
199 */
6a585c61 200#error "Unsupported ISA type"
201#endif
202
203#if defined(_ILP32) && defined(_LP64)
204#error "Both _ILP32 and _LP64 are defined"
205#endif
206
225c1106
BB
207#if !defined(_ILP32) && !defined(_LP64)
208#error "Neither _ILP32 or _LP64 are defined"
209#endif
210
6a585c61 211#include <sys/byteorder.h>
212
213#if defined(__LITTLE_ENDIAN) && !defined(_LITTLE_ENDIAN)
5461eefe 214#define _LITTLE_ENDIAN __LITTLE_ENDIAN
6a585c61 215#endif
216
217#if defined(__BIG_ENDIAN) && !defined(_BIG_ENDIAN)
5461eefe 218#define _BIG_ENDIAN __BIG_ENDIAN
6a585c61 219#endif
220
221#if defined(_LITTLE_ENDIAN) && defined(_BIG_ENDIAN)
b11b08ed
BB
222#error "Both _LITTLE_ENDIAN and _BIG_ENDIAN are defined"
223#endif
224
225#if !defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)
226#error "Neither _LITTLE_ENDIAN or _BIG_ENDIAN are defined"
6a585c61 227#endif
228
4a4295b2 229#endif /* _SPL_ISA_DEFS_H */