xref: /onnv-gate/usr/src/uts/common/sys/isa_defs.h (revision 7720:8b0e0a8b0931)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
51253Slq150181  * Common Development and Distribution License (the "License").
61253Slq150181  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
13*7720SKen.Erickson@Sun.COM  *
140Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate  *
200Sstevel@tonic-gate  * CDDL HEADER END
210Sstevel@tonic-gate  */
221253Slq150181 
230Sstevel@tonic-gate /*
247372SRoger.Faulkner@Sun.COM  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
250Sstevel@tonic-gate  * Use is subject to license terms.
260Sstevel@tonic-gate  */
270Sstevel@tonic-gate 
280Sstevel@tonic-gate #ifndef	_SYS_ISA_DEFS_H
290Sstevel@tonic-gate #define	_SYS_ISA_DEFS_H
300Sstevel@tonic-gate 
310Sstevel@tonic-gate /*
320Sstevel@tonic-gate  * This header file serves to group a set of well known defines and to
330Sstevel@tonic-gate  * set these for each instruction set architecture.  These defines may
340Sstevel@tonic-gate  * be divided into two groups;  characteristics of the processor and
350Sstevel@tonic-gate  * implementation choices for Solaris on a processor.
360Sstevel@tonic-gate  *
370Sstevel@tonic-gate  * Processor Characteristics:
380Sstevel@tonic-gate  *
390Sstevel@tonic-gate  * _LITTLE_ENDIAN / _BIG_ENDIAN:
400Sstevel@tonic-gate  *	The natural byte order of the processor.  A pointer to an int points
410Sstevel@tonic-gate  *	to the least/most significant byte of that int.
420Sstevel@tonic-gate  *
430Sstevel@tonic-gate  * _STACK_GROWS_UPWARD / _STACK_GROWS_DOWNWARD:
440Sstevel@tonic-gate  *	The processor specific direction of stack growth.  A push onto the
450Sstevel@tonic-gate  *	stack increases/decreases the stack pointer, so it stores data at
460Sstevel@tonic-gate  *	successively higher/lower addresses.  (Stackless machines ignored
470Sstevel@tonic-gate  *	without regrets).
480Sstevel@tonic-gate  *
490Sstevel@tonic-gate  * _LONG_LONG_HTOL / _LONG_LONG_LTOH:
500Sstevel@tonic-gate  *	A pointer to a long long points to the most/least significant long
510Sstevel@tonic-gate  *	within that long long.
520Sstevel@tonic-gate  *
530Sstevel@tonic-gate  * _BIT_FIELDS_HTOL / _BIT_FIELDS_LTOH:
540Sstevel@tonic-gate  *	The C compiler assigns bit fields from the high/low to the low/high end
550Sstevel@tonic-gate  *	of an int (most to least significant vs. least to most significant).
560Sstevel@tonic-gate  *
570Sstevel@tonic-gate  * _IEEE_754:
580Sstevel@tonic-gate  *	The processor (or supported implementations of the processor)
590Sstevel@tonic-gate  *	supports the ieee-754 floating point standard.  No other floating
600Sstevel@tonic-gate  *	point standards are supported (or significant).  Any other supported
610Sstevel@tonic-gate  *	floating point formats are expected to be cased on the ISA processor
620Sstevel@tonic-gate  *	symbol.
630Sstevel@tonic-gate  *
640Sstevel@tonic-gate  * _CHAR_IS_UNSIGNED / _CHAR_IS_SIGNED:
650Sstevel@tonic-gate  *	The C Compiler implements objects of type `char' as `unsigned' or
660Sstevel@tonic-gate  *	`signed' respectively.  This is really an implementation choice of
670Sstevel@tonic-gate  *	the compiler writer, but it is specified in the ABI and tends to
680Sstevel@tonic-gate  *	be uniform across compilers for an instruction set architecture.
690Sstevel@tonic-gate  *	Hence, it has the properties of a processor characteristic.
700Sstevel@tonic-gate  *
710Sstevel@tonic-gate  * _CHAR_ALIGNMENT / _SHORT_ALIGNMENT / _INT_ALIGNMENT / _LONG_ALIGNMENT /
720Sstevel@tonic-gate  * _LONG_LONG_ALIGNMENT / _DOUBLE_ALIGNMENT / _LONG_DOUBLE_ALIGNMENT /
730Sstevel@tonic-gate  * _POINTER_ALIGNMENT / _FLOAT_ALIGNMENT:
740Sstevel@tonic-gate  *	The ABI defines alignment requirements of each of the primitive
750Sstevel@tonic-gate  *	object types.  Some, if not all, may be hardware requirements as
760Sstevel@tonic-gate  * 	well.  The values are expressed in "byte-alignment" units.
770Sstevel@tonic-gate  *
780Sstevel@tonic-gate  * _MAX_ALIGNMENT:
790Sstevel@tonic-gate  *	The most stringent alignment requirement as specified by the ABI.
800Sstevel@tonic-gate  *	Equal to the maximum of all the above _XXX_ALIGNMENT values.
810Sstevel@tonic-gate  *
820Sstevel@tonic-gate  * _ALIGNMENT_REQUIRED:
830Sstevel@tonic-gate  *	True or false (1 or 0) whether or not the hardware requires the ABI
840Sstevel@tonic-gate  *	alignment.
850Sstevel@tonic-gate  *
860Sstevel@tonic-gate  * _LONG_LONG_ALIGNMENT_32
870Sstevel@tonic-gate  *	The 32-bit ABI supported by a 64-bit kernel may have different
880Sstevel@tonic-gate  *	alignment requirements for primitive object types.  The value of this
890Sstevel@tonic-gate  *	identifier is expressed in "byte-alignment" units.
900Sstevel@tonic-gate  *
910Sstevel@tonic-gate  * _HAVE_CPUID_INSN
920Sstevel@tonic-gate  *	This indicates that the architecture supports the 'cpuid'
930Sstevel@tonic-gate  *	instruction as defined by Intel.  (Intel allows other vendors
940Sstevel@tonic-gate  *	to extend the instruction for their own purposes.)
950Sstevel@tonic-gate  *
960Sstevel@tonic-gate  *
970Sstevel@tonic-gate  * Implementation Choices:
980Sstevel@tonic-gate  *
990Sstevel@tonic-gate  * _ILP32 / _LP64:
1000Sstevel@tonic-gate  *	This specifies the compiler data type implementation as specified in
1010Sstevel@tonic-gate  *	the relevant ABI.  The choice between these is strongly influenced
1020Sstevel@tonic-gate  *	by the underlying hardware, but is not absolutely tied to it.
1030Sstevel@tonic-gate  *	Currently only two data type models are supported:
1040Sstevel@tonic-gate  *
1050Sstevel@tonic-gate  *	_ILP32:
1060Sstevel@tonic-gate  *		Int/Long/Pointer are 32 bits.  This is the historical UNIX
1070Sstevel@tonic-gate  *		and Solaris implementation.  Due to its historical standing,
1080Sstevel@tonic-gate  *		this is the default case.
1090Sstevel@tonic-gate  *
1100Sstevel@tonic-gate  *	_LP64:
1110Sstevel@tonic-gate  *		Long/Pointer are 64 bits, Int is 32 bits.  This is the chosen
1120Sstevel@tonic-gate  *		implementation for 64-bit ABIs such as SPARC V9.
1130Sstevel@tonic-gate  *
1140Sstevel@tonic-gate  *	_I32LPx:
1150Sstevel@tonic-gate  *		A compilation environment where 'int' is 32-bit, and
1160Sstevel@tonic-gate  *		longs and pointers are simply the same size.
1170Sstevel@tonic-gate  *
1180Sstevel@tonic-gate  *	In all cases, Char is 8 bits and Short is 16 bits.
1190Sstevel@tonic-gate  *
1200Sstevel@tonic-gate  * _SUNOS_VTOC_8 / _SUNOS_VTOC_16 / _SVR4_VTOC_16:
1210Sstevel@tonic-gate  *	This specifies the form of the disk VTOC (or label):
1220Sstevel@tonic-gate  *
1230Sstevel@tonic-gate  *	_SUNOS_VTOC_8:
1240Sstevel@tonic-gate  *		This is a VTOC form which is upwardly compatible with the
1250Sstevel@tonic-gate  *		SunOS 4.x disk label and allows 8 partitions per disk.
1260Sstevel@tonic-gate  *
1270Sstevel@tonic-gate  *	_SUNOS_VTOC_16:
1280Sstevel@tonic-gate  *		In this format the incore vtoc image matches the ondisk
1290Sstevel@tonic-gate  *		version.  It allows 16 slices per disk, and is not
1300Sstevel@tonic-gate  *		compatible with the SunOS 4.x disk label.
1310Sstevel@tonic-gate  *
1320Sstevel@tonic-gate  *	Note that these are not the only two VTOC forms possible and
1330Sstevel@tonic-gate  *	additional forms may be added.  One possible form would be the
1340Sstevel@tonic-gate  *	SVr4 VTOC form.  The symbol for that is reserved now, although
1350Sstevel@tonic-gate  *	it is not implemented.
1360Sstevel@tonic-gate  *
1370Sstevel@tonic-gate  *	_SVR4_VTOC_16:
1380Sstevel@tonic-gate  *		This VTOC form is compatible with the System V Release 4
1390Sstevel@tonic-gate  *		VTOC (as implemented on the SVr4 Intel and 3b ports) with
1400Sstevel@tonic-gate  *		16 partitions per disk.
1410Sstevel@tonic-gate  *
1420Sstevel@tonic-gate  *
1430Sstevel@tonic-gate  * _DMA_USES_PHYSADDR / _DMA_USES_VIRTADDR
1440Sstevel@tonic-gate  *	This describes the type of addresses used by system DMA:
1450Sstevel@tonic-gate  *
1460Sstevel@tonic-gate  *	_DMA_USES_PHYSADDR:
1470Sstevel@tonic-gate  *		This type of DMA, used in the x86 implementation,
1480Sstevel@tonic-gate  *		requires physical addresses for DMA buffers.  The 24-bit
1490Sstevel@tonic-gate  *		addresses used by some legacy boards is the source of the
1500Sstevel@tonic-gate  *		"low-memory" (<16MB) requirement for some devices using DMA.
1510Sstevel@tonic-gate  *
1520Sstevel@tonic-gate  *	_DMA_USES_VIRTADDR:
1530Sstevel@tonic-gate  *		This method of DMA allows the use of virtual addresses for
1540Sstevel@tonic-gate  *		DMA transfers.
1550Sstevel@tonic-gate  *
1560Sstevel@tonic-gate  * _FIRMWARE_NEEDS_FDISK / _NO_FDISK_PRESENT
1570Sstevel@tonic-gate  *      This indicates the presence/absence of an fdisk table.
1580Sstevel@tonic-gate  *
1590Sstevel@tonic-gate  *      _FIRMWARE_NEEDS_FDISK
1600Sstevel@tonic-gate  *              The fdisk table is required by system firmware.  If present,
1610Sstevel@tonic-gate  *              it allows a disk to be subdivided into multiple fdisk
1620Sstevel@tonic-gate  *              partitions, each of which is equivalent to a separate,
1630Sstevel@tonic-gate  *              virtual disk.  This enables the co-existence of multiple
1640Sstevel@tonic-gate  *              operating systems on a shared hard disk.
1650Sstevel@tonic-gate  *
1660Sstevel@tonic-gate  *      _NO_FDISK_PRESENT
1670Sstevel@tonic-gate  *              If the fdisk table is absent, it is assumed that the entire
1680Sstevel@tonic-gate  *              media is allocated for a single operating system.
1690Sstevel@tonic-gate  *
1701253Slq150181  * _HAVE_TEM_FIRMWARE
1711253Slq150181  *	Defined if this architecture has the (fallback) option of
1721253Slq150181  *	using prom_* calls for doing I/O if a suitable kernel driver
1731253Slq150181  *	is not available to do it.
1740Sstevel@tonic-gate  *
1751253Slq150181  * _DONT_USE_1275_GENERIC_NAMES
1760Sstevel@tonic-gate  *		Controls whether or not device tree node names should
1770Sstevel@tonic-gate  *		comply with the IEEE 1275 "Generic Names" Recommended
1780Sstevel@tonic-gate  *		Practice. With _DONT_USE_GENERIC_NAMES, device-specific
1790Sstevel@tonic-gate  *		names identifying the particular device will be used.
1800Sstevel@tonic-gate  *
1810Sstevel@tonic-gate  * __i386_COMPAT
1820Sstevel@tonic-gate  *	This indicates whether the i386 ABI is supported as a *non-native*
1830Sstevel@tonic-gate  *	mode for the platform.  When this symbol is defined:
1840Sstevel@tonic-gate  *	-	32-bit xstat-style system calls are enabled
1850Sstevel@tonic-gate  *	-	32-bit xmknod-style system calls are enabled
1860Sstevel@tonic-gate  *	-	32-bit system calls use i386 sizes -and- alignments
1870Sstevel@tonic-gate  *
1880Sstevel@tonic-gate  *	Note that this is NOT defined for the i386 native environment!
1890Sstevel@tonic-gate  *
1900Sstevel@tonic-gate  * __x86
1910Sstevel@tonic-gate  *	This is ONLY a synonym for defined(__i386) || defined(__amd64)
1920Sstevel@tonic-gate  *	which is useful only insofar as these two architectures share
1930Sstevel@tonic-gate  *	common attributes.  Analogous to __sparc.
1940Sstevel@tonic-gate  *
1950Sstevel@tonic-gate  * _PSM_MODULES
1960Sstevel@tonic-gate  *	This indicates whether or not the implementation uses PSM
1970Sstevel@tonic-gate  *	modules for processor support, reading /etc/mach from inside
1980Sstevel@tonic-gate  *	the kernel to extract a list.
1990Sstevel@tonic-gate  *
2000Sstevel@tonic-gate  * _RTC_CONFIG
2010Sstevel@tonic-gate  *	This indicates whether or not the implementation uses /etc/rtc_config
2020Sstevel@tonic-gate  *	to configure the real-time clock in the kernel.
2033446Smrj  *
2043446Smrj  * _UNIX_KRTLD
2053446Smrj  *	This indicates that the implementation uses a dynamically
2063446Smrj  *	linked unix + krtld to form the core kernel image at boot
2073446Smrj  *	time, or (in the absence of this symbol) a prelinked kernel image.
2085648Ssetje  *
2095648Ssetje  * _OBP
2105648Ssetje  *	This indicates the firmware interface is OBP.
211*7720SKen.Erickson@Sun.COM  *
212*7720SKen.Erickson@Sun.COM  * _SOFT_HOSTID
213*7720SKen.Erickson@Sun.COM  *	This indicates that the implementation obtains the hostid
214*7720SKen.Erickson@Sun.COM  *	from the file /etc/hostid, rather than from hardware.
2150Sstevel@tonic-gate  */
2160Sstevel@tonic-gate 
2170Sstevel@tonic-gate #ifdef	__cplusplus
2180Sstevel@tonic-gate extern "C" {
2190Sstevel@tonic-gate #endif
2200Sstevel@tonic-gate 
2210Sstevel@tonic-gate /*
2220Sstevel@tonic-gate  * The following set of definitions characterize Solaris on AMD's
2230Sstevel@tonic-gate  * 64-bit systems.
2240Sstevel@tonic-gate  */
225641Skalai #if defined(__x86_64) || defined(__amd64)
2260Sstevel@tonic-gate 
2270Sstevel@tonic-gate #if !defined(__amd64)
2280Sstevel@tonic-gate #define	__amd64		/* preferred guard */
2290Sstevel@tonic-gate #endif
2300Sstevel@tonic-gate 
2310Sstevel@tonic-gate #if !defined(__x86)
2320Sstevel@tonic-gate #define	__x86
2330Sstevel@tonic-gate #endif
2340Sstevel@tonic-gate 
2350Sstevel@tonic-gate /*
2360Sstevel@tonic-gate  * Define the appropriate "processor characteristics"
2370Sstevel@tonic-gate  */
2380Sstevel@tonic-gate #define	_LITTLE_ENDIAN
2390Sstevel@tonic-gate #define	_STACK_GROWS_DOWNWARD
2400Sstevel@tonic-gate #define	_LONG_LONG_LTOH
2410Sstevel@tonic-gate #define	_BIT_FIELDS_LTOH
2420Sstevel@tonic-gate #define	_IEEE_754
2430Sstevel@tonic-gate #define	_CHAR_IS_SIGNED
2440Sstevel@tonic-gate #define	_BOOL_ALIGNMENT			1
2450Sstevel@tonic-gate #define	_CHAR_ALIGNMENT			1
2460Sstevel@tonic-gate #define	_SHORT_ALIGNMENT		2
2470Sstevel@tonic-gate #define	_INT_ALIGNMENT			4
2480Sstevel@tonic-gate #define	_FLOAT_ALIGNMENT		4
2490Sstevel@tonic-gate #define	_FLOAT_COMPLEX_ALIGNMENT	4
2500Sstevel@tonic-gate #define	_LONG_ALIGNMENT			8
2510Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT		8
2520Sstevel@tonic-gate #define	_DOUBLE_ALIGNMENT		8
2530Sstevel@tonic-gate #define	_DOUBLE_COMPLEX_ALIGNMENT	8
2540Sstevel@tonic-gate #define	_LONG_DOUBLE_ALIGNMENT		16
2550Sstevel@tonic-gate #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	16
2560Sstevel@tonic-gate #define	_POINTER_ALIGNMENT		8
2570Sstevel@tonic-gate #define	_MAX_ALIGNMENT			16
2580Sstevel@tonic-gate #define	_ALIGNMENT_REQUIRED		1
2590Sstevel@tonic-gate 
2600Sstevel@tonic-gate /*
2610Sstevel@tonic-gate  * Different alignment constraints for the i386 ABI in compatibility mode
2620Sstevel@tonic-gate  */
2630Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT_32		4
2640Sstevel@tonic-gate 
2650Sstevel@tonic-gate /*
2660Sstevel@tonic-gate  * Define the appropriate "implementation choices".
2670Sstevel@tonic-gate  */
2680Sstevel@tonic-gate #if !defined(_LP64)
2690Sstevel@tonic-gate #define	_LP64
2700Sstevel@tonic-gate #endif
2710Sstevel@tonic-gate #if !defined(_I32LPx) && defined(_KERNEL)
2720Sstevel@tonic-gate #define	_I32LPx
2730Sstevel@tonic-gate #endif
2740Sstevel@tonic-gate #define	_MULTI_DATAMODEL
2750Sstevel@tonic-gate #define	_SUNOS_VTOC_16
2760Sstevel@tonic-gate #define	_DMA_USES_PHYSADDR
2770Sstevel@tonic-gate #define	_FIRMWARE_NEEDS_FDISK
2780Sstevel@tonic-gate #define	__i386_COMPAT
2790Sstevel@tonic-gate #define	_PSM_MODULES
2800Sstevel@tonic-gate #define	_RTC_CONFIG
281*7720SKen.Erickson@Sun.COM #define	_SOFT_HOSTID
2820Sstevel@tonic-gate #define	_DONT_USE_1275_GENERIC_NAMES
2830Sstevel@tonic-gate #define	_HAVE_CPUID_INSN
2840Sstevel@tonic-gate 
2850Sstevel@tonic-gate /*
2860Sstevel@tonic-gate  * The feature test macro __i386 is generic for all processors implementing
2870Sstevel@tonic-gate  * the Intel 386 instruction set or a superset of it.  Specifically, this
2880Sstevel@tonic-gate  * includes all members of the 386, 486, and Pentium family of processors.
2890Sstevel@tonic-gate  */
2900Sstevel@tonic-gate #elif defined(__i386) || defined(__i386__)
2910Sstevel@tonic-gate 
2920Sstevel@tonic-gate #if !defined(__i386)
2930Sstevel@tonic-gate #define	__i386
2940Sstevel@tonic-gate #endif
2950Sstevel@tonic-gate 
2960Sstevel@tonic-gate #if !defined(__x86)
2970Sstevel@tonic-gate #define	__x86
2980Sstevel@tonic-gate #endif
2990Sstevel@tonic-gate 
3000Sstevel@tonic-gate /*
3010Sstevel@tonic-gate  * Define the appropriate "processor characteristics"
3020Sstevel@tonic-gate  */
3030Sstevel@tonic-gate #define	_LITTLE_ENDIAN
3040Sstevel@tonic-gate #define	_STACK_GROWS_DOWNWARD
3050Sstevel@tonic-gate #define	_LONG_LONG_LTOH
3060Sstevel@tonic-gate #define	_BIT_FIELDS_LTOH
3070Sstevel@tonic-gate #define	_IEEE_754
3080Sstevel@tonic-gate #define	_CHAR_IS_SIGNED
3090Sstevel@tonic-gate #define	_BOOL_ALIGNMENT			1
3100Sstevel@tonic-gate #define	_CHAR_ALIGNMENT			1
3110Sstevel@tonic-gate #define	_SHORT_ALIGNMENT		2
3120Sstevel@tonic-gate #define	_INT_ALIGNMENT			4
3130Sstevel@tonic-gate #define	_FLOAT_ALIGNMENT		4
3140Sstevel@tonic-gate #define	_FLOAT_COMPLEX_ALIGNMENT	4
3150Sstevel@tonic-gate #define	_LONG_ALIGNMENT			4
3160Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT		4
3170Sstevel@tonic-gate #define	_DOUBLE_ALIGNMENT		4
3180Sstevel@tonic-gate #define	_DOUBLE_COMPLEX_ALIGNMENT	4
3190Sstevel@tonic-gate #define	_LONG_DOUBLE_ALIGNMENT		4
3200Sstevel@tonic-gate #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	4
3210Sstevel@tonic-gate #define	_POINTER_ALIGNMENT		4
3220Sstevel@tonic-gate #define	_MAX_ALIGNMENT			4
3230Sstevel@tonic-gate #define	_ALIGNMENT_REQUIRED		0
3240Sstevel@tonic-gate 
3250Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGNMENT
3260Sstevel@tonic-gate 
3270Sstevel@tonic-gate /*
3280Sstevel@tonic-gate  * Define the appropriate "implementation choices".
3290Sstevel@tonic-gate  */
3300Sstevel@tonic-gate #define	_ILP32
3310Sstevel@tonic-gate #if !defined(_I32LPx) && defined(_KERNEL)
3320Sstevel@tonic-gate #define	_I32LPx
3330Sstevel@tonic-gate #endif
3340Sstevel@tonic-gate #define	_SUNOS_VTOC_16
3350Sstevel@tonic-gate #define	_DMA_USES_PHYSADDR
3360Sstevel@tonic-gate #define	_FIRMWARE_NEEDS_FDISK
3370Sstevel@tonic-gate #define	_PSM_MODULES
3380Sstevel@tonic-gate #define	_RTC_CONFIG
339*7720SKen.Erickson@Sun.COM #define	_SOFT_HOSTID
3400Sstevel@tonic-gate #define	_DONT_USE_1275_GENERIC_NAMES
3410Sstevel@tonic-gate #define	_HAVE_CPUID_INSN
3420Sstevel@tonic-gate 
3430Sstevel@tonic-gate /*
3440Sstevel@tonic-gate  * The following set of definitions characterize the Solaris on SPARC systems.
3450Sstevel@tonic-gate  *
3460Sstevel@tonic-gate  * The symbol __sparc indicates any of the SPARC family of processor
3470Sstevel@tonic-gate  * architectures.  This includes SPARC V7, SPARC V8 and SPARC V9.
3480Sstevel@tonic-gate  *
3490Sstevel@tonic-gate  * The symbol __sparcv8 indicates the 32-bit SPARC V8 architecture as defined
3500Sstevel@tonic-gate  * by Version 8 of the SPARC Architecture Manual.  (SPARC V7 is close enough
3510Sstevel@tonic-gate  * to SPARC V8 for the former to be subsumed into the latter definition.)
3520Sstevel@tonic-gate  *
3530Sstevel@tonic-gate  * The symbol __sparcv9 indicates the 64-bit SPARC V9 architecture as defined
3540Sstevel@tonic-gate  * by Version 9 of the SPARC Architecture Manual.
3550Sstevel@tonic-gate  *
3560Sstevel@tonic-gate  * The symbols __sparcv8 and __sparcv9 are mutually exclusive, and are only
3570Sstevel@tonic-gate  * relevant when the symbol __sparc is defined.
3580Sstevel@tonic-gate  */
3590Sstevel@tonic-gate /*
3600Sstevel@tonic-gate  * XXX Due to the existence of 5110166, "defined(__sparcv9)" needs to be added
3610Sstevel@tonic-gate  * to support backwards builds.  This workaround should be removed in s10_71.
3620Sstevel@tonic-gate  */
3630Sstevel@tonic-gate #elif defined(__sparc) || defined(__sparcv9) || defined(__sparc__)
3640Sstevel@tonic-gate #if !defined(__sparc)
3650Sstevel@tonic-gate #define	__sparc
3660Sstevel@tonic-gate #endif
3670Sstevel@tonic-gate 
3680Sstevel@tonic-gate /*
3690Sstevel@tonic-gate  * You can be 32-bit or 64-bit, but not both at the same time.
3700Sstevel@tonic-gate  */
3710Sstevel@tonic-gate #if defined(__sparcv8) && defined(__sparcv9)
3720Sstevel@tonic-gate #error	"SPARC Versions 8 and 9 are mutually exclusive choices"
3730Sstevel@tonic-gate #endif
3740Sstevel@tonic-gate 
3750Sstevel@tonic-gate /*
3760Sstevel@tonic-gate  * Existing compilers do not set __sparcv8.  Years will transpire before
3770Sstevel@tonic-gate  * the compilers can be depended on to set the feature test macro. In
3780Sstevel@tonic-gate  * the interim, we'll set it here on the basis of historical behaviour;
3790Sstevel@tonic-gate  * if you haven't asked for SPARC V9, then you must've meant SPARC V8.
3800Sstevel@tonic-gate  */
3810Sstevel@tonic-gate #if !defined(__sparcv9) && !defined(__sparcv8)
3820Sstevel@tonic-gate #define	__sparcv8
3830Sstevel@tonic-gate #endif
3840Sstevel@tonic-gate 
3850Sstevel@tonic-gate /*
3860Sstevel@tonic-gate  * Define the appropriate "processor characteristics" shared between
3870Sstevel@tonic-gate  * all Solaris on SPARC systems.
3880Sstevel@tonic-gate  */
3890Sstevel@tonic-gate #define	_BIG_ENDIAN
3900Sstevel@tonic-gate #define	_STACK_GROWS_DOWNWARD
3910Sstevel@tonic-gate #define	_LONG_LONG_HTOL
3920Sstevel@tonic-gate #define	_BIT_FIELDS_HTOL
3930Sstevel@tonic-gate #define	_IEEE_754
3940Sstevel@tonic-gate #define	_CHAR_IS_SIGNED
3950Sstevel@tonic-gate #define	_BOOL_ALIGNMENT			1
3960Sstevel@tonic-gate #define	_CHAR_ALIGNMENT			1
3970Sstevel@tonic-gate #define	_SHORT_ALIGNMENT		2
3980Sstevel@tonic-gate #define	_INT_ALIGNMENT			4
3990Sstevel@tonic-gate #define	_FLOAT_ALIGNMENT		4
4000Sstevel@tonic-gate #define	_FLOAT_COMPLEX_ALIGNMENT	4
4010Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT		8
4020Sstevel@tonic-gate #define	_DOUBLE_ALIGNMENT		8
4030Sstevel@tonic-gate #define	_DOUBLE_COMPLEX_ALIGNMENT	8
4040Sstevel@tonic-gate #define	_ALIGNMENT_REQUIRED		1
4050Sstevel@tonic-gate 
4060Sstevel@tonic-gate /*
4070Sstevel@tonic-gate  * Define the appropriate "implementation choices" shared between versions.
4080Sstevel@tonic-gate  */
4090Sstevel@tonic-gate #define	_SUNOS_VTOC_8
4100Sstevel@tonic-gate #define	_DMA_USES_VIRTADDR
4110Sstevel@tonic-gate #define	_NO_FDISK_PRESENT
4121253Slq150181 #define	_HAVE_TEM_FIRMWARE
4135648Ssetje #define	_OBP
4140Sstevel@tonic-gate 
4150Sstevel@tonic-gate /*
4160Sstevel@tonic-gate  * The following set of definitions characterize the implementation of
4170Sstevel@tonic-gate  * 32-bit Solaris on SPARC V8 systems.
4180Sstevel@tonic-gate  */
4190Sstevel@tonic-gate #if defined(__sparcv8)
4200Sstevel@tonic-gate 
4210Sstevel@tonic-gate /*
4220Sstevel@tonic-gate  * Define the appropriate "processor characteristics"
4230Sstevel@tonic-gate  */
4240Sstevel@tonic-gate #define	_LONG_ALIGNMENT			4
4250Sstevel@tonic-gate #define	_LONG_DOUBLE_ALIGNMENT		8
4260Sstevel@tonic-gate #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	8
4270Sstevel@tonic-gate #define	_POINTER_ALIGNMENT		4
4280Sstevel@tonic-gate #define	_MAX_ALIGNMENT			8
4290Sstevel@tonic-gate 
4300Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGNMENT
4310Sstevel@tonic-gate 
4320Sstevel@tonic-gate /*
4330Sstevel@tonic-gate  * Define the appropriate "implementation choices"
4340Sstevel@tonic-gate  */
4350Sstevel@tonic-gate #define	_ILP32
4360Sstevel@tonic-gate #if !defined(_I32LPx) && defined(_KERNEL)
4370Sstevel@tonic-gate #define	_I32LPx
4380Sstevel@tonic-gate #endif
4390Sstevel@tonic-gate 
4400Sstevel@tonic-gate /*
4410Sstevel@tonic-gate  * The following set of definitions characterize the implementation of
4420Sstevel@tonic-gate  * 64-bit Solaris on SPARC V9 systems.
4430Sstevel@tonic-gate  */
4440Sstevel@tonic-gate #elif defined(__sparcv9)
4450Sstevel@tonic-gate 
4460Sstevel@tonic-gate /*
4470Sstevel@tonic-gate  * Define the appropriate "processor characteristics"
4480Sstevel@tonic-gate  */
4490Sstevel@tonic-gate #define	_LONG_ALIGNMENT			8
4500Sstevel@tonic-gate #define	_LONG_DOUBLE_ALIGNMENT		16
4510Sstevel@tonic-gate #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	16
4520Sstevel@tonic-gate #define	_POINTER_ALIGNMENT		8
4530Sstevel@tonic-gate #define	_MAX_ALIGNMENT			16
4540Sstevel@tonic-gate 
4557372SRoger.Faulkner@Sun.COM #define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGNMENT
4560Sstevel@tonic-gate 
4570Sstevel@tonic-gate /*
4580Sstevel@tonic-gate  * Define the appropriate "implementation choices"
4590Sstevel@tonic-gate  */
4600Sstevel@tonic-gate #if !defined(_LP64)
4610Sstevel@tonic-gate #define	_LP64
4620Sstevel@tonic-gate #endif
4630Sstevel@tonic-gate #if !defined(_I32LPx)
4640Sstevel@tonic-gate #define	_I32LPx
4650Sstevel@tonic-gate #endif
4660Sstevel@tonic-gate #define	_MULTI_DATAMODEL
4670Sstevel@tonic-gate 
4680Sstevel@tonic-gate #else
4690Sstevel@tonic-gate #error	"unknown SPARC version"
4700Sstevel@tonic-gate #endif
4710Sstevel@tonic-gate 
4720Sstevel@tonic-gate /*
4730Sstevel@tonic-gate  * #error is strictly ansi-C, but works as well as anything for K&R systems.
4740Sstevel@tonic-gate  */
4750Sstevel@tonic-gate #else
4760Sstevel@tonic-gate #error "ISA not supported"
4770Sstevel@tonic-gate #endif
4780Sstevel@tonic-gate 
4790Sstevel@tonic-gate #if defined(_ILP32) && defined(_LP64)
4800Sstevel@tonic-gate #error "Both _ILP32 and _LP64 are defined"
4810Sstevel@tonic-gate #endif
4820Sstevel@tonic-gate 
4830Sstevel@tonic-gate #ifdef	__cplusplus
4840Sstevel@tonic-gate }
4850Sstevel@tonic-gate #endif
4860Sstevel@tonic-gate 
4870Sstevel@tonic-gate #endif	/* _SYS_ISA_DEFS_H */
488