xref: /illumos-gate/usr/src/uts/common/sys/isa_defs.h (revision 7c478bd95313f5f23a4c958a745db2134aa0324)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate #ifndef	_SYS_ISA_DEFS_H
28*7c478bd9Sstevel@tonic-gate #define	_SYS_ISA_DEFS_H
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*7c478bd9Sstevel@tonic-gate 
32*7c478bd9Sstevel@tonic-gate /*
33*7c478bd9Sstevel@tonic-gate  * This header file serves to group a set of well known defines and to
34*7c478bd9Sstevel@tonic-gate  * set these for each instruction set architecture.  These defines may
35*7c478bd9Sstevel@tonic-gate  * be divided into two groups;  characteristics of the processor and
36*7c478bd9Sstevel@tonic-gate  * implementation choices for Solaris on a processor.
37*7c478bd9Sstevel@tonic-gate  *
38*7c478bd9Sstevel@tonic-gate  * Processor Characteristics:
39*7c478bd9Sstevel@tonic-gate  *
40*7c478bd9Sstevel@tonic-gate  * _LITTLE_ENDIAN / _BIG_ENDIAN:
41*7c478bd9Sstevel@tonic-gate  *	The natural byte order of the processor.  A pointer to an int points
42*7c478bd9Sstevel@tonic-gate  *	to the least/most significant byte of that int.
43*7c478bd9Sstevel@tonic-gate  *
44*7c478bd9Sstevel@tonic-gate  * _STACK_GROWS_UPWARD / _STACK_GROWS_DOWNWARD:
45*7c478bd9Sstevel@tonic-gate  *	The processor specific direction of stack growth.  A push onto the
46*7c478bd9Sstevel@tonic-gate  *	stack increases/decreases the stack pointer, so it stores data at
47*7c478bd9Sstevel@tonic-gate  *	successively higher/lower addresses.  (Stackless machines ignored
48*7c478bd9Sstevel@tonic-gate  *	without regrets).
49*7c478bd9Sstevel@tonic-gate  *
50*7c478bd9Sstevel@tonic-gate  * _LONG_LONG_HTOL / _LONG_LONG_LTOH:
51*7c478bd9Sstevel@tonic-gate  *	A pointer to a long long points to the most/least significant long
52*7c478bd9Sstevel@tonic-gate  *	within that long long.
53*7c478bd9Sstevel@tonic-gate  *
54*7c478bd9Sstevel@tonic-gate  * _BIT_FIELDS_HTOL / _BIT_FIELDS_LTOH:
55*7c478bd9Sstevel@tonic-gate  *	The C compiler assigns bit fields from the high/low to the low/high end
56*7c478bd9Sstevel@tonic-gate  *	of an int (most to least significant vs. least to most significant).
57*7c478bd9Sstevel@tonic-gate  *
58*7c478bd9Sstevel@tonic-gate  * _IEEE_754:
59*7c478bd9Sstevel@tonic-gate  *	The processor (or supported implementations of the processor)
60*7c478bd9Sstevel@tonic-gate  *	supports the ieee-754 floating point standard.  No other floating
61*7c478bd9Sstevel@tonic-gate  *	point standards are supported (or significant).  Any other supported
62*7c478bd9Sstevel@tonic-gate  *	floating point formats are expected to be cased on the ISA processor
63*7c478bd9Sstevel@tonic-gate  *	symbol.
64*7c478bd9Sstevel@tonic-gate  *
65*7c478bd9Sstevel@tonic-gate  * _CHAR_IS_UNSIGNED / _CHAR_IS_SIGNED:
66*7c478bd9Sstevel@tonic-gate  *	The C Compiler implements objects of type `char' as `unsigned' or
67*7c478bd9Sstevel@tonic-gate  *	`signed' respectively.  This is really an implementation choice of
68*7c478bd9Sstevel@tonic-gate  *	the compiler writer, but it is specified in the ABI and tends to
69*7c478bd9Sstevel@tonic-gate  *	be uniform across compilers for an instruction set architecture.
70*7c478bd9Sstevel@tonic-gate  *	Hence, it has the properties of a processor characteristic.
71*7c478bd9Sstevel@tonic-gate  *
72*7c478bd9Sstevel@tonic-gate  * _CHAR_ALIGNMENT / _SHORT_ALIGNMENT / _INT_ALIGNMENT / _LONG_ALIGNMENT /
73*7c478bd9Sstevel@tonic-gate  * _LONG_LONG_ALIGNMENT / _DOUBLE_ALIGNMENT / _LONG_DOUBLE_ALIGNMENT /
74*7c478bd9Sstevel@tonic-gate  * _POINTER_ALIGNMENT / _FLOAT_ALIGNMENT:
75*7c478bd9Sstevel@tonic-gate  *	The ABI defines alignment requirements of each of the primitive
76*7c478bd9Sstevel@tonic-gate  *	object types.  Some, if not all, may be hardware requirements as
77*7c478bd9Sstevel@tonic-gate  * 	well.  The values are expressed in "byte-alignment" units.
78*7c478bd9Sstevel@tonic-gate  *
79*7c478bd9Sstevel@tonic-gate  * _MAX_ALIGNMENT:
80*7c478bd9Sstevel@tonic-gate  *	The most stringent alignment requirement as specified by the ABI.
81*7c478bd9Sstevel@tonic-gate  *	Equal to the maximum of all the above _XXX_ALIGNMENT values.
82*7c478bd9Sstevel@tonic-gate  *
83*7c478bd9Sstevel@tonic-gate  * _ALIGNMENT_REQUIRED:
84*7c478bd9Sstevel@tonic-gate  *	True or false (1 or 0) whether or not the hardware requires the ABI
85*7c478bd9Sstevel@tonic-gate  *	alignment.
86*7c478bd9Sstevel@tonic-gate  *
87*7c478bd9Sstevel@tonic-gate  * _LONG_LONG_ALIGNMENT_32
88*7c478bd9Sstevel@tonic-gate  *	The 32-bit ABI supported by a 64-bit kernel may have different
89*7c478bd9Sstevel@tonic-gate  *	alignment requirements for primitive object types.  The value of this
90*7c478bd9Sstevel@tonic-gate  *	identifier is expressed in "byte-alignment" units.
91*7c478bd9Sstevel@tonic-gate  *
92*7c478bd9Sstevel@tonic-gate  * _HAVE_CPUID_INSN
93*7c478bd9Sstevel@tonic-gate  *	This indicates that the architecture supports the 'cpuid'
94*7c478bd9Sstevel@tonic-gate  *	instruction as defined by Intel.  (Intel allows other vendors
95*7c478bd9Sstevel@tonic-gate  *	to extend the instruction for their own purposes.)
96*7c478bd9Sstevel@tonic-gate  *
97*7c478bd9Sstevel@tonic-gate  *
98*7c478bd9Sstevel@tonic-gate  * Implementation Choices:
99*7c478bd9Sstevel@tonic-gate  *
100*7c478bd9Sstevel@tonic-gate  * _ILP32 / _LP64:
101*7c478bd9Sstevel@tonic-gate  *	This specifies the compiler data type implementation as specified in
102*7c478bd9Sstevel@tonic-gate  *	the relevant ABI.  The choice between these is strongly influenced
103*7c478bd9Sstevel@tonic-gate  *	by the underlying hardware, but is not absolutely tied to it.
104*7c478bd9Sstevel@tonic-gate  *	Currently only two data type models are supported:
105*7c478bd9Sstevel@tonic-gate  *
106*7c478bd9Sstevel@tonic-gate  *	_ILP32:
107*7c478bd9Sstevel@tonic-gate  *		Int/Long/Pointer are 32 bits.  This is the historical UNIX
108*7c478bd9Sstevel@tonic-gate  *		and Solaris implementation.  Due to its historical standing,
109*7c478bd9Sstevel@tonic-gate  *		this is the default case.
110*7c478bd9Sstevel@tonic-gate  *
111*7c478bd9Sstevel@tonic-gate  *	_LP64:
112*7c478bd9Sstevel@tonic-gate  *		Long/Pointer are 64 bits, Int is 32 bits.  This is the chosen
113*7c478bd9Sstevel@tonic-gate  *		implementation for 64-bit ABIs such as SPARC V9.
114*7c478bd9Sstevel@tonic-gate  *
115*7c478bd9Sstevel@tonic-gate  *	_I32LPx:
116*7c478bd9Sstevel@tonic-gate  *		A compilation environment where 'int' is 32-bit, and
117*7c478bd9Sstevel@tonic-gate  *		longs and pointers are simply the same size.
118*7c478bd9Sstevel@tonic-gate  *
119*7c478bd9Sstevel@tonic-gate  *	In all cases, Char is 8 bits and Short is 16 bits.
120*7c478bd9Sstevel@tonic-gate  *
121*7c478bd9Sstevel@tonic-gate  * _SUNOS_VTOC_8 / _SUNOS_VTOC_16 / _SVR4_VTOC_16:
122*7c478bd9Sstevel@tonic-gate  *	This specifies the form of the disk VTOC (or label):
123*7c478bd9Sstevel@tonic-gate  *
124*7c478bd9Sstevel@tonic-gate  *	_SUNOS_VTOC_8:
125*7c478bd9Sstevel@tonic-gate  *		This is a VTOC form which is upwardly compatible with the
126*7c478bd9Sstevel@tonic-gate  *		SunOS 4.x disk label and allows 8 partitions per disk.
127*7c478bd9Sstevel@tonic-gate  *
128*7c478bd9Sstevel@tonic-gate  *	_SUNOS_VTOC_16:
129*7c478bd9Sstevel@tonic-gate  *		In this format the incore vtoc image matches the ondisk
130*7c478bd9Sstevel@tonic-gate  *		version.  It allows 16 slices per disk, and is not
131*7c478bd9Sstevel@tonic-gate  *		compatible with the SunOS 4.x disk label.
132*7c478bd9Sstevel@tonic-gate  *
133*7c478bd9Sstevel@tonic-gate  *	Note that these are not the only two VTOC forms possible and
134*7c478bd9Sstevel@tonic-gate  *	additional forms may be added.  One possible form would be the
135*7c478bd9Sstevel@tonic-gate  *	SVr4 VTOC form.  The symbol for that is reserved now, although
136*7c478bd9Sstevel@tonic-gate  *	it is not implemented.
137*7c478bd9Sstevel@tonic-gate  *
138*7c478bd9Sstevel@tonic-gate  *	_SVR4_VTOC_16:
139*7c478bd9Sstevel@tonic-gate  *		This VTOC form is compatible with the System V Release 4
140*7c478bd9Sstevel@tonic-gate  *		VTOC (as implemented on the SVr4 Intel and 3b ports) with
141*7c478bd9Sstevel@tonic-gate  *		16 partitions per disk.
142*7c478bd9Sstevel@tonic-gate  *
143*7c478bd9Sstevel@tonic-gate  *
144*7c478bd9Sstevel@tonic-gate  * _DMA_USES_PHYSADDR / _DMA_USES_VIRTADDR
145*7c478bd9Sstevel@tonic-gate  *	This describes the type of addresses used by system DMA:
146*7c478bd9Sstevel@tonic-gate  *
147*7c478bd9Sstevel@tonic-gate  *	_DMA_USES_PHYSADDR:
148*7c478bd9Sstevel@tonic-gate  *		This type of DMA, used in the x86 implementation,
149*7c478bd9Sstevel@tonic-gate  *		requires physical addresses for DMA buffers.  The 24-bit
150*7c478bd9Sstevel@tonic-gate  *		addresses used by some legacy boards is the source of the
151*7c478bd9Sstevel@tonic-gate  *		"low-memory" (<16MB) requirement for some devices using DMA.
152*7c478bd9Sstevel@tonic-gate  *
153*7c478bd9Sstevel@tonic-gate  *	_DMA_USES_VIRTADDR:
154*7c478bd9Sstevel@tonic-gate  *		This method of DMA allows the use of virtual addresses for
155*7c478bd9Sstevel@tonic-gate  *		DMA transfers.
156*7c478bd9Sstevel@tonic-gate  *
157*7c478bd9Sstevel@tonic-gate  * _FIRMWARE_NEEDS_FDISK / _NO_FDISK_PRESENT
158*7c478bd9Sstevel@tonic-gate  *      This indicates the presence/absence of an fdisk table.
159*7c478bd9Sstevel@tonic-gate  *
160*7c478bd9Sstevel@tonic-gate  *      _FIRMWARE_NEEDS_FDISK
161*7c478bd9Sstevel@tonic-gate  *              The fdisk table is required by system firmware.  If present,
162*7c478bd9Sstevel@tonic-gate  *              it allows a disk to be subdivided into multiple fdisk
163*7c478bd9Sstevel@tonic-gate  *              partitions, each of which is equivalent to a separate,
164*7c478bd9Sstevel@tonic-gate  *              virtual disk.  This enables the co-existence of multiple
165*7c478bd9Sstevel@tonic-gate  *              operating systems on a shared hard disk.
166*7c478bd9Sstevel@tonic-gate  *
167*7c478bd9Sstevel@tonic-gate  *      _NO_FDISK_PRESENT
168*7c478bd9Sstevel@tonic-gate  *              If the fdisk table is absent, it is assumed that the entire
169*7c478bd9Sstevel@tonic-gate  *              media is allocated for a single operating system.
170*7c478bd9Sstevel@tonic-gate  *
171*7c478bd9Sstevel@tonic-gate  * _CONSOLE_OUTPUT_VIA_FIRMWARE / _CONSOLE_OUTPUT_VIA_SOFTWARE
172*7c478bd9Sstevel@tonic-gate  *	This indicates whether framebuffer console output is done by
173*7c478bd9Sstevel@tonic-gate  *	firmware or software.
174*7c478bd9Sstevel@tonic-gate  *
175*7c478bd9Sstevel@tonic-gate  *	_CONSOLE_OUTPUT_VIA_FIRMWARE
176*7c478bd9Sstevel@tonic-gate  *		Framebuffer console output is done via prom_* calls.
177*7c478bd9Sstevel@tonic-gate  *
178*7c478bd9Sstevel@tonic-gate  *	_CONSOLE_OUTPUT_VIA_SOFTWARE
179*7c478bd9Sstevel@tonic-gate  *		Framebuffer console output is done via the software
180*7c478bd9Sstevel@tonic-gate  *		terminal emulator.
181*7c478bd9Sstevel@tonic-gate  *	_DONT_USE_1275_GENERIC_NAMES
182*7c478bd9Sstevel@tonic-gate  *		Controls whether or not device tree node names should
183*7c478bd9Sstevel@tonic-gate  *		comply with the IEEE 1275 "Generic Names" Recommended
184*7c478bd9Sstevel@tonic-gate  *		Practice. With _DONT_USE_GENERIC_NAMES, device-specific
185*7c478bd9Sstevel@tonic-gate  *		names identifying the particular device will be used.
186*7c478bd9Sstevel@tonic-gate  *
187*7c478bd9Sstevel@tonic-gate  * __i386_COMPAT
188*7c478bd9Sstevel@tonic-gate  *	This indicates whether the i386 ABI is supported as a *non-native*
189*7c478bd9Sstevel@tonic-gate  *	mode for the platform.  When this symbol is defined:
190*7c478bd9Sstevel@tonic-gate  *	-	32-bit xstat-style system calls are enabled
191*7c478bd9Sstevel@tonic-gate  *	-	32-bit xmknod-style system calls are enabled
192*7c478bd9Sstevel@tonic-gate  *	-	32-bit system calls use i386 sizes -and- alignments
193*7c478bd9Sstevel@tonic-gate  *
194*7c478bd9Sstevel@tonic-gate  *	Note that this is NOT defined for the i386 native environment!
195*7c478bd9Sstevel@tonic-gate  *
196*7c478bd9Sstevel@tonic-gate  * __x86
197*7c478bd9Sstevel@tonic-gate  *	This is ONLY a synonym for defined(__i386) || defined(__amd64)
198*7c478bd9Sstevel@tonic-gate  *	which is useful only insofar as these two architectures share
199*7c478bd9Sstevel@tonic-gate  *	common attributes.  Analogous to __sparc.
200*7c478bd9Sstevel@tonic-gate  *
201*7c478bd9Sstevel@tonic-gate  * _PSM_MODULES
202*7c478bd9Sstevel@tonic-gate  *	This indicates whether or not the implementation uses PSM
203*7c478bd9Sstevel@tonic-gate  *	modules for processor support, reading /etc/mach from inside
204*7c478bd9Sstevel@tonic-gate  *	the kernel to extract a list.
205*7c478bd9Sstevel@tonic-gate  *
206*7c478bd9Sstevel@tonic-gate  * _RTC_CONFIG
207*7c478bd9Sstevel@tonic-gate  *	This indicates whether or not the implementation uses /etc/rtc_config
208*7c478bd9Sstevel@tonic-gate  *	to configure the real-time clock in the kernel.
209*7c478bd9Sstevel@tonic-gate  */
210*7c478bd9Sstevel@tonic-gate 
211*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
212*7c478bd9Sstevel@tonic-gate extern "C" {
213*7c478bd9Sstevel@tonic-gate #endif
214*7c478bd9Sstevel@tonic-gate 
215*7c478bd9Sstevel@tonic-gate /*
216*7c478bd9Sstevel@tonic-gate  * The feature test macro __ia64 is generic for all processors implementing
217*7c478bd9Sstevel@tonic-gate  * the Intel ia64 instruction set.
218*7c478bd9Sstevel@tonic-gate  */
219*7c478bd9Sstevel@tonic-gate #if defined(__ia64) || defined(__ia64__)
220*7c478bd9Sstevel@tonic-gate #if !defined(__ia64)
221*7c478bd9Sstevel@tonic-gate #define	__ia64
222*7c478bd9Sstevel@tonic-gate #endif
223*7c478bd9Sstevel@tonic-gate 
224*7c478bd9Sstevel@tonic-gate /*
225*7c478bd9Sstevel@tonic-gate  * Define the appropriate "processor characteristics"
226*7c478bd9Sstevel@tonic-gate  */
227*7c478bd9Sstevel@tonic-gate #define	_LITTLE_ENDIAN
228*7c478bd9Sstevel@tonic-gate #define	_STACK_GROWS_DOWNWARD		/* sort of */
229*7c478bd9Sstevel@tonic-gate #define	_LONG_LONG_LTOH
230*7c478bd9Sstevel@tonic-gate #define	_BIT_FIELDS_LTOH
231*7c478bd9Sstevel@tonic-gate #define	_IEEE_754
232*7c478bd9Sstevel@tonic-gate #define	_CHAR_IS_SIGNED
233*7c478bd9Sstevel@tonic-gate #define	_CHAR_ALIGNMENT		1
234*7c478bd9Sstevel@tonic-gate #define	_SHORT_ALIGNMENT	2
235*7c478bd9Sstevel@tonic-gate #define	_INT_ALIGNMENT		4
236*7c478bd9Sstevel@tonic-gate #define	_FLOAT_ALIGNMENT	4
237*7c478bd9Sstevel@tonic-gate #define	_LONG_ALIGNMENT		8
238*7c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT	8
239*7c478bd9Sstevel@tonic-gate #define	_DOUBLE_ALIGNMENT	8
240*7c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_ALIGNMENT	16
241*7c478bd9Sstevel@tonic-gate #define	_POINTER_ALIGNMENT	8
242*7c478bd9Sstevel@tonic-gate #define	_MAX_ALIGNMENT		16
243*7c478bd9Sstevel@tonic-gate #define	_ALIGNMENT_REQUIRED	1
244*7c478bd9Sstevel@tonic-gate 
245*7c478bd9Sstevel@tonic-gate /*
246*7c478bd9Sstevel@tonic-gate  * Different alignment constraints for the i386 ABI in compatibility mode
247*7c478bd9Sstevel@tonic-gate  */
248*7c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT_32	4
249*7c478bd9Sstevel@tonic-gate 
250*7c478bd9Sstevel@tonic-gate /*
251*7c478bd9Sstevel@tonic-gate  * Define the appropriate "implementation choices".
252*7c478bd9Sstevel@tonic-gate  */
253*7c478bd9Sstevel@tonic-gate #if !defined(_LP64)
254*7c478bd9Sstevel@tonic-gate #define	_LP64
255*7c478bd9Sstevel@tonic-gate #endif
256*7c478bd9Sstevel@tonic-gate #if !defined(_I32LPx) && defined(_KERNEL)
257*7c478bd9Sstevel@tonic-gate #define	_I32LPx
258*7c478bd9Sstevel@tonic-gate #endif
259*7c478bd9Sstevel@tonic-gate #define	_MULTI_DATAMODEL
260*7c478bd9Sstevel@tonic-gate #define	_SUNOS_VTOC_16
261*7c478bd9Sstevel@tonic-gate #define	_DMA_USES_PHYSADDR
262*7c478bd9Sstevel@tonic-gate #define	_FIRMWARE_NEEDS_FDISK
263*7c478bd9Sstevel@tonic-gate #define	_CONSOLE_OUTPUT_VIA_SOFTWARE
264*7c478bd9Sstevel@tonic-gate #define	__i386_COMPAT
265*7c478bd9Sstevel@tonic-gate #define	_PSM_MODULES
266*7c478bd9Sstevel@tonic-gate #define	_RTC_CONFIG
267*7c478bd9Sstevel@tonic-gate #define	_HAVE_CPUID_INSN
268*7c478bd9Sstevel@tonic-gate 
269*7c478bd9Sstevel@tonic-gate /*
270*7c478bd9Sstevel@tonic-gate  * The following set of definitions characterize Solaris on AMD's
271*7c478bd9Sstevel@tonic-gate  * 64-bit systems.
272*7c478bd9Sstevel@tonic-gate  */
273*7c478bd9Sstevel@tonic-gate #elif defined(__x86_64) || defined(__amd64)
274*7c478bd9Sstevel@tonic-gate 
275*7c478bd9Sstevel@tonic-gate #if !defined(__amd64)
276*7c478bd9Sstevel@tonic-gate #define	__amd64		/* preferred guard */
277*7c478bd9Sstevel@tonic-gate #endif
278*7c478bd9Sstevel@tonic-gate 
279*7c478bd9Sstevel@tonic-gate #if !defined(__x86)
280*7c478bd9Sstevel@tonic-gate #define	__x86
281*7c478bd9Sstevel@tonic-gate #endif
282*7c478bd9Sstevel@tonic-gate 
283*7c478bd9Sstevel@tonic-gate /*
284*7c478bd9Sstevel@tonic-gate  * Define the appropriate "processor characteristics"
285*7c478bd9Sstevel@tonic-gate  */
286*7c478bd9Sstevel@tonic-gate #define	_LITTLE_ENDIAN
287*7c478bd9Sstevel@tonic-gate #define	_STACK_GROWS_DOWNWARD
288*7c478bd9Sstevel@tonic-gate #define	_LONG_LONG_LTOH
289*7c478bd9Sstevel@tonic-gate #define	_BIT_FIELDS_LTOH
290*7c478bd9Sstevel@tonic-gate #define	_IEEE_754
291*7c478bd9Sstevel@tonic-gate #define	_CHAR_IS_SIGNED
292*7c478bd9Sstevel@tonic-gate #define	_BOOL_ALIGNMENT			1
293*7c478bd9Sstevel@tonic-gate #define	_CHAR_ALIGNMENT			1
294*7c478bd9Sstevel@tonic-gate #define	_SHORT_ALIGNMENT		2
295*7c478bd9Sstevel@tonic-gate #define	_INT_ALIGNMENT			4
296*7c478bd9Sstevel@tonic-gate #define	_FLOAT_ALIGNMENT		4
297*7c478bd9Sstevel@tonic-gate #define	_FLOAT_COMPLEX_ALIGNMENT	4
298*7c478bd9Sstevel@tonic-gate #define	_LONG_ALIGNMENT			8
299*7c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT		8
300*7c478bd9Sstevel@tonic-gate #define	_DOUBLE_ALIGNMENT		8
301*7c478bd9Sstevel@tonic-gate #define	_DOUBLE_COMPLEX_ALIGNMENT	8
302*7c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_ALIGNMENT		16
303*7c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	16
304*7c478bd9Sstevel@tonic-gate #define	_POINTER_ALIGNMENT		8
305*7c478bd9Sstevel@tonic-gate #define	_MAX_ALIGNMENT			16
306*7c478bd9Sstevel@tonic-gate #define	_ALIGNMENT_REQUIRED		1
307*7c478bd9Sstevel@tonic-gate 
308*7c478bd9Sstevel@tonic-gate /*
309*7c478bd9Sstevel@tonic-gate  * Different alignment constraints for the i386 ABI in compatibility mode
310*7c478bd9Sstevel@tonic-gate  */
311*7c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT_32		4
312*7c478bd9Sstevel@tonic-gate 
313*7c478bd9Sstevel@tonic-gate /*
314*7c478bd9Sstevel@tonic-gate  * Define the appropriate "implementation choices".
315*7c478bd9Sstevel@tonic-gate  */
316*7c478bd9Sstevel@tonic-gate #if !defined(_LP64)
317*7c478bd9Sstevel@tonic-gate #define	_LP64
318*7c478bd9Sstevel@tonic-gate #endif
319*7c478bd9Sstevel@tonic-gate #if !defined(_I32LPx) && defined(_KERNEL)
320*7c478bd9Sstevel@tonic-gate #define	_I32LPx
321*7c478bd9Sstevel@tonic-gate #endif
322*7c478bd9Sstevel@tonic-gate #define	_MULTI_DATAMODEL
323*7c478bd9Sstevel@tonic-gate #define	_SUNOS_VTOC_16
324*7c478bd9Sstevel@tonic-gate #define	_DMA_USES_PHYSADDR
325*7c478bd9Sstevel@tonic-gate #define	_FIRMWARE_NEEDS_FDISK
326*7c478bd9Sstevel@tonic-gate #define	_CONSOLE_OUTPUT_VIA_SOFTWARE
327*7c478bd9Sstevel@tonic-gate #define	__i386_COMPAT
328*7c478bd9Sstevel@tonic-gate #define	_PSM_MODULES
329*7c478bd9Sstevel@tonic-gate #define	_RTC_CONFIG
330*7c478bd9Sstevel@tonic-gate #define	_DONT_USE_1275_GENERIC_NAMES
331*7c478bd9Sstevel@tonic-gate #define	_HAVE_CPUID_INSN
332*7c478bd9Sstevel@tonic-gate 
333*7c478bd9Sstevel@tonic-gate /*
334*7c478bd9Sstevel@tonic-gate  * The feature test macro __i386 is generic for all processors implementing
335*7c478bd9Sstevel@tonic-gate  * the Intel 386 instruction set or a superset of it.  Specifically, this
336*7c478bd9Sstevel@tonic-gate  * includes all members of the 386, 486, and Pentium family of processors.
337*7c478bd9Sstevel@tonic-gate  */
338*7c478bd9Sstevel@tonic-gate #elif defined(__i386) || defined(__i386__)
339*7c478bd9Sstevel@tonic-gate 
340*7c478bd9Sstevel@tonic-gate #if !defined(__i386)
341*7c478bd9Sstevel@tonic-gate #define	__i386
342*7c478bd9Sstevel@tonic-gate #endif
343*7c478bd9Sstevel@tonic-gate 
344*7c478bd9Sstevel@tonic-gate #if !defined(__x86)
345*7c478bd9Sstevel@tonic-gate #define	__x86
346*7c478bd9Sstevel@tonic-gate #endif
347*7c478bd9Sstevel@tonic-gate 
348*7c478bd9Sstevel@tonic-gate /*
349*7c478bd9Sstevel@tonic-gate  * Define the appropriate "processor characteristics"
350*7c478bd9Sstevel@tonic-gate  */
351*7c478bd9Sstevel@tonic-gate #define	_LITTLE_ENDIAN
352*7c478bd9Sstevel@tonic-gate #define	_STACK_GROWS_DOWNWARD
353*7c478bd9Sstevel@tonic-gate #define	_LONG_LONG_LTOH
354*7c478bd9Sstevel@tonic-gate #define	_BIT_FIELDS_LTOH
355*7c478bd9Sstevel@tonic-gate #define	_IEEE_754
356*7c478bd9Sstevel@tonic-gate #define	_CHAR_IS_SIGNED
357*7c478bd9Sstevel@tonic-gate #define	_BOOL_ALIGNMENT			1
358*7c478bd9Sstevel@tonic-gate #define	_CHAR_ALIGNMENT			1
359*7c478bd9Sstevel@tonic-gate #define	_SHORT_ALIGNMENT		2
360*7c478bd9Sstevel@tonic-gate #define	_INT_ALIGNMENT			4
361*7c478bd9Sstevel@tonic-gate #define	_FLOAT_ALIGNMENT		4
362*7c478bd9Sstevel@tonic-gate #define	_FLOAT_COMPLEX_ALIGNMENT	4
363*7c478bd9Sstevel@tonic-gate #define	_LONG_ALIGNMENT			4
364*7c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT		4
365*7c478bd9Sstevel@tonic-gate #define	_DOUBLE_ALIGNMENT		4
366*7c478bd9Sstevel@tonic-gate #define	_DOUBLE_COMPLEX_ALIGNMENT	4
367*7c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_ALIGNMENT		4
368*7c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	4
369*7c478bd9Sstevel@tonic-gate #define	_POINTER_ALIGNMENT		4
370*7c478bd9Sstevel@tonic-gate #define	_MAX_ALIGNMENT			4
371*7c478bd9Sstevel@tonic-gate #define	_ALIGNMENT_REQUIRED		0
372*7c478bd9Sstevel@tonic-gate 
373*7c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGNMENT
374*7c478bd9Sstevel@tonic-gate 
375*7c478bd9Sstevel@tonic-gate /*
376*7c478bd9Sstevel@tonic-gate  * Define the appropriate "implementation choices".
377*7c478bd9Sstevel@tonic-gate  */
378*7c478bd9Sstevel@tonic-gate #define	_ILP32
379*7c478bd9Sstevel@tonic-gate #if !defined(_I32LPx) && defined(_KERNEL)
380*7c478bd9Sstevel@tonic-gate #define	_I32LPx
381*7c478bd9Sstevel@tonic-gate #endif
382*7c478bd9Sstevel@tonic-gate #define	_SUNOS_VTOC_16
383*7c478bd9Sstevel@tonic-gate #define	_DMA_USES_PHYSADDR
384*7c478bd9Sstevel@tonic-gate #define	_FIRMWARE_NEEDS_FDISK
385*7c478bd9Sstevel@tonic-gate #define	_CONSOLE_OUTPUT_VIA_SOFTWARE
386*7c478bd9Sstevel@tonic-gate #define	_PSM_MODULES
387*7c478bd9Sstevel@tonic-gate #define	_RTC_CONFIG
388*7c478bd9Sstevel@tonic-gate #define	_DONT_USE_1275_GENERIC_NAMES
389*7c478bd9Sstevel@tonic-gate #define	_HAVE_CPUID_INSN
390*7c478bd9Sstevel@tonic-gate 
391*7c478bd9Sstevel@tonic-gate /*
392*7c478bd9Sstevel@tonic-gate  * The following set of definitions characterize the Solaris on SPARC systems.
393*7c478bd9Sstevel@tonic-gate  *
394*7c478bd9Sstevel@tonic-gate  * The symbol __sparc indicates any of the SPARC family of processor
395*7c478bd9Sstevel@tonic-gate  * architectures.  This includes SPARC V7, SPARC V8 and SPARC V9.
396*7c478bd9Sstevel@tonic-gate  *
397*7c478bd9Sstevel@tonic-gate  * The symbol __sparcv8 indicates the 32-bit SPARC V8 architecture as defined
398*7c478bd9Sstevel@tonic-gate  * by Version 8 of the SPARC Architecture Manual.  (SPARC V7 is close enough
399*7c478bd9Sstevel@tonic-gate  * to SPARC V8 for the former to be subsumed into the latter definition.)
400*7c478bd9Sstevel@tonic-gate  *
401*7c478bd9Sstevel@tonic-gate  * The symbol __sparcv9 indicates the 64-bit SPARC V9 architecture as defined
402*7c478bd9Sstevel@tonic-gate  * by Version 9 of the SPARC Architecture Manual.
403*7c478bd9Sstevel@tonic-gate  *
404*7c478bd9Sstevel@tonic-gate  * The symbols __sparcv8 and __sparcv9 are mutually exclusive, and are only
405*7c478bd9Sstevel@tonic-gate  * relevant when the symbol __sparc is defined.
406*7c478bd9Sstevel@tonic-gate  */
407*7c478bd9Sstevel@tonic-gate /*
408*7c478bd9Sstevel@tonic-gate  * XXX Due to the existence of 5110166, "defined(__sparcv9)" needs to be added
409*7c478bd9Sstevel@tonic-gate  * to support backwards builds.  This workaround should be removed in s10_71.
410*7c478bd9Sstevel@tonic-gate  */
411*7c478bd9Sstevel@tonic-gate #elif defined(__sparc) || defined(__sparcv9) || defined(__sparc__)
412*7c478bd9Sstevel@tonic-gate #if !defined(__sparc)
413*7c478bd9Sstevel@tonic-gate #define	__sparc
414*7c478bd9Sstevel@tonic-gate #endif
415*7c478bd9Sstevel@tonic-gate 
416*7c478bd9Sstevel@tonic-gate /*
417*7c478bd9Sstevel@tonic-gate  * You can be 32-bit or 64-bit, but not both at the same time.
418*7c478bd9Sstevel@tonic-gate  */
419*7c478bd9Sstevel@tonic-gate #if defined(__sparcv8) && defined(__sparcv9)
420*7c478bd9Sstevel@tonic-gate #error	"SPARC Versions 8 and 9 are mutually exclusive choices"
421*7c478bd9Sstevel@tonic-gate #endif
422*7c478bd9Sstevel@tonic-gate 
423*7c478bd9Sstevel@tonic-gate /*
424*7c478bd9Sstevel@tonic-gate  * Existing compilers do not set __sparcv8.  Years will transpire before
425*7c478bd9Sstevel@tonic-gate  * the compilers can be depended on to set the feature test macro. In
426*7c478bd9Sstevel@tonic-gate  * the interim, we'll set it here on the basis of historical behaviour;
427*7c478bd9Sstevel@tonic-gate  * if you haven't asked for SPARC V9, then you must've meant SPARC V8.
428*7c478bd9Sstevel@tonic-gate  */
429*7c478bd9Sstevel@tonic-gate #if !defined(__sparcv9) && !defined(__sparcv8)
430*7c478bd9Sstevel@tonic-gate #define	__sparcv8
431*7c478bd9Sstevel@tonic-gate #endif
432*7c478bd9Sstevel@tonic-gate 
433*7c478bd9Sstevel@tonic-gate /*
434*7c478bd9Sstevel@tonic-gate  * Define the appropriate "processor characteristics" shared between
435*7c478bd9Sstevel@tonic-gate  * all Solaris on SPARC systems.
436*7c478bd9Sstevel@tonic-gate  */
437*7c478bd9Sstevel@tonic-gate #define	_BIG_ENDIAN
438*7c478bd9Sstevel@tonic-gate #define	_STACK_GROWS_DOWNWARD
439*7c478bd9Sstevel@tonic-gate #define	_LONG_LONG_HTOL
440*7c478bd9Sstevel@tonic-gate #define	_BIT_FIELDS_HTOL
441*7c478bd9Sstevel@tonic-gate #define	_IEEE_754
442*7c478bd9Sstevel@tonic-gate #define	_CHAR_IS_SIGNED
443*7c478bd9Sstevel@tonic-gate #define	_BOOL_ALIGNMENT			1
444*7c478bd9Sstevel@tonic-gate #define	_CHAR_ALIGNMENT			1
445*7c478bd9Sstevel@tonic-gate #define	_SHORT_ALIGNMENT		2
446*7c478bd9Sstevel@tonic-gate #define	_INT_ALIGNMENT			4
447*7c478bd9Sstevel@tonic-gate #define	_FLOAT_ALIGNMENT		4
448*7c478bd9Sstevel@tonic-gate #define	_FLOAT_COMPLEX_ALIGNMENT	4
449*7c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT		8
450*7c478bd9Sstevel@tonic-gate #define	_DOUBLE_ALIGNMENT		8
451*7c478bd9Sstevel@tonic-gate #define	_DOUBLE_COMPLEX_ALIGNMENT	8
452*7c478bd9Sstevel@tonic-gate #define	_ALIGNMENT_REQUIRED		1
453*7c478bd9Sstevel@tonic-gate 
454*7c478bd9Sstevel@tonic-gate /*
455*7c478bd9Sstevel@tonic-gate  * Define the appropriate "implementation choices" shared between versions.
456*7c478bd9Sstevel@tonic-gate  */
457*7c478bd9Sstevel@tonic-gate #define	_SUNOS_VTOC_8
458*7c478bd9Sstevel@tonic-gate #define	_DMA_USES_VIRTADDR
459*7c478bd9Sstevel@tonic-gate #define	_NO_FDISK_PRESENT
460*7c478bd9Sstevel@tonic-gate #define	_CONSOLE_OUTPUT_VIA_FIRMWARE
461*7c478bd9Sstevel@tonic-gate 
462*7c478bd9Sstevel@tonic-gate /*
463*7c478bd9Sstevel@tonic-gate  * The following set of definitions characterize the implementation of
464*7c478bd9Sstevel@tonic-gate  * 32-bit Solaris on SPARC V8 systems.
465*7c478bd9Sstevel@tonic-gate  */
466*7c478bd9Sstevel@tonic-gate #if defined(__sparcv8)
467*7c478bd9Sstevel@tonic-gate 
468*7c478bd9Sstevel@tonic-gate /*
469*7c478bd9Sstevel@tonic-gate  * Define the appropriate "processor characteristics"
470*7c478bd9Sstevel@tonic-gate  */
471*7c478bd9Sstevel@tonic-gate #define	_LONG_ALIGNMENT			4
472*7c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_ALIGNMENT		8
473*7c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	8
474*7c478bd9Sstevel@tonic-gate #define	_POINTER_ALIGNMENT		4
475*7c478bd9Sstevel@tonic-gate #define	_MAX_ALIGNMENT			8
476*7c478bd9Sstevel@tonic-gate 
477*7c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGNMENT
478*7c478bd9Sstevel@tonic-gate 
479*7c478bd9Sstevel@tonic-gate /*
480*7c478bd9Sstevel@tonic-gate  * Define the appropriate "implementation choices"
481*7c478bd9Sstevel@tonic-gate  */
482*7c478bd9Sstevel@tonic-gate #define	_ILP32
483*7c478bd9Sstevel@tonic-gate #if !defined(_I32LPx) && defined(_KERNEL)
484*7c478bd9Sstevel@tonic-gate #define	_I32LPx
485*7c478bd9Sstevel@tonic-gate #endif
486*7c478bd9Sstevel@tonic-gate 
487*7c478bd9Sstevel@tonic-gate /*
488*7c478bd9Sstevel@tonic-gate  * The following set of definitions characterize the implementation of
489*7c478bd9Sstevel@tonic-gate  * 64-bit Solaris on SPARC V9 systems.
490*7c478bd9Sstevel@tonic-gate  */
491*7c478bd9Sstevel@tonic-gate #elif defined(__sparcv9)
492*7c478bd9Sstevel@tonic-gate 
493*7c478bd9Sstevel@tonic-gate /*
494*7c478bd9Sstevel@tonic-gate  * Define the appropriate "processor characteristics"
495*7c478bd9Sstevel@tonic-gate  */
496*7c478bd9Sstevel@tonic-gate #define	_LONG_ALIGNMENT			8
497*7c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_ALIGNMENT		16
498*7c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	16
499*7c478bd9Sstevel@tonic-gate #define	_POINTER_ALIGNMENT		8
500*7c478bd9Sstevel@tonic-gate #define	_MAX_ALIGNMENT			16
501*7c478bd9Sstevel@tonic-gate 
502*7c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGMENT
503*7c478bd9Sstevel@tonic-gate 
504*7c478bd9Sstevel@tonic-gate /*
505*7c478bd9Sstevel@tonic-gate  * Define the appropriate "implementation choices"
506*7c478bd9Sstevel@tonic-gate  */
507*7c478bd9Sstevel@tonic-gate #if !defined(_LP64)
508*7c478bd9Sstevel@tonic-gate #define	_LP64
509*7c478bd9Sstevel@tonic-gate #endif
510*7c478bd9Sstevel@tonic-gate #if !defined(_I32LPx)
511*7c478bd9Sstevel@tonic-gate #define	_I32LPx
512*7c478bd9Sstevel@tonic-gate #endif
513*7c478bd9Sstevel@tonic-gate #define	_MULTI_DATAMODEL
514*7c478bd9Sstevel@tonic-gate 
515*7c478bd9Sstevel@tonic-gate #else
516*7c478bd9Sstevel@tonic-gate #error	"unknown SPARC version"
517*7c478bd9Sstevel@tonic-gate #endif
518*7c478bd9Sstevel@tonic-gate 
519*7c478bd9Sstevel@tonic-gate /*
520*7c478bd9Sstevel@tonic-gate  * #error is strictly ansi-C, but works as well as anything for K&R systems.
521*7c478bd9Sstevel@tonic-gate  */
522*7c478bd9Sstevel@tonic-gate #else
523*7c478bd9Sstevel@tonic-gate #error "ISA not supported"
524*7c478bd9Sstevel@tonic-gate #endif
525*7c478bd9Sstevel@tonic-gate 
526*7c478bd9Sstevel@tonic-gate #if defined(_ILP32) && defined(_LP64)
527*7c478bd9Sstevel@tonic-gate #error "Both _ILP32 and _LP64 are defined"
528*7c478bd9Sstevel@tonic-gate #endif
529*7c478bd9Sstevel@tonic-gate 
530*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
531*7c478bd9Sstevel@tonic-gate }
532*7c478bd9Sstevel@tonic-gate #endif
533*7c478bd9Sstevel@tonic-gate 
534*7c478bd9Sstevel@tonic-gate #endif	/* _SYS_ISA_DEFS_H */
535