xref: /illumos-gate/usr/src/uts/common/sys/isa_defs.h (revision fea9cb91)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*fea9cb91Slq  * Common Development and Distribution License (the "License").
6*fea9cb91Slq  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
21*fea9cb91Slq 
227c478bd9Sstevel@tonic-gate /*
23*fea9cb91Slq  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef	_SYS_ISA_DEFS_H
287c478bd9Sstevel@tonic-gate #define	_SYS_ISA_DEFS_H
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate /*
337c478bd9Sstevel@tonic-gate  * This header file serves to group a set of well known defines and to
347c478bd9Sstevel@tonic-gate  * set these for each instruction set architecture.  These defines may
357c478bd9Sstevel@tonic-gate  * be divided into two groups;  characteristics of the processor and
367c478bd9Sstevel@tonic-gate  * implementation choices for Solaris on a processor.
377c478bd9Sstevel@tonic-gate  *
387c478bd9Sstevel@tonic-gate  * Processor Characteristics:
397c478bd9Sstevel@tonic-gate  *
407c478bd9Sstevel@tonic-gate  * _LITTLE_ENDIAN / _BIG_ENDIAN:
417c478bd9Sstevel@tonic-gate  *	The natural byte order of the processor.  A pointer to an int points
427c478bd9Sstevel@tonic-gate  *	to the least/most significant byte of that int.
437c478bd9Sstevel@tonic-gate  *
447c478bd9Sstevel@tonic-gate  * _STACK_GROWS_UPWARD / _STACK_GROWS_DOWNWARD:
457c478bd9Sstevel@tonic-gate  *	The processor specific direction of stack growth.  A push onto the
467c478bd9Sstevel@tonic-gate  *	stack increases/decreases the stack pointer, so it stores data at
477c478bd9Sstevel@tonic-gate  *	successively higher/lower addresses.  (Stackless machines ignored
487c478bd9Sstevel@tonic-gate  *	without regrets).
497c478bd9Sstevel@tonic-gate  *
507c478bd9Sstevel@tonic-gate  * _LONG_LONG_HTOL / _LONG_LONG_LTOH:
517c478bd9Sstevel@tonic-gate  *	A pointer to a long long points to the most/least significant long
527c478bd9Sstevel@tonic-gate  *	within that long long.
537c478bd9Sstevel@tonic-gate  *
547c478bd9Sstevel@tonic-gate  * _BIT_FIELDS_HTOL / _BIT_FIELDS_LTOH:
557c478bd9Sstevel@tonic-gate  *	The C compiler assigns bit fields from the high/low to the low/high end
567c478bd9Sstevel@tonic-gate  *	of an int (most to least significant vs. least to most significant).
577c478bd9Sstevel@tonic-gate  *
587c478bd9Sstevel@tonic-gate  * _IEEE_754:
597c478bd9Sstevel@tonic-gate  *	The processor (or supported implementations of the processor)
607c478bd9Sstevel@tonic-gate  *	supports the ieee-754 floating point standard.  No other floating
617c478bd9Sstevel@tonic-gate  *	point standards are supported (or significant).  Any other supported
627c478bd9Sstevel@tonic-gate  *	floating point formats are expected to be cased on the ISA processor
637c478bd9Sstevel@tonic-gate  *	symbol.
647c478bd9Sstevel@tonic-gate  *
657c478bd9Sstevel@tonic-gate  * _CHAR_IS_UNSIGNED / _CHAR_IS_SIGNED:
667c478bd9Sstevel@tonic-gate  *	The C Compiler implements objects of type `char' as `unsigned' or
677c478bd9Sstevel@tonic-gate  *	`signed' respectively.  This is really an implementation choice of
687c478bd9Sstevel@tonic-gate  *	the compiler writer, but it is specified in the ABI and tends to
697c478bd9Sstevel@tonic-gate  *	be uniform across compilers for an instruction set architecture.
707c478bd9Sstevel@tonic-gate  *	Hence, it has the properties of a processor characteristic.
717c478bd9Sstevel@tonic-gate  *
727c478bd9Sstevel@tonic-gate  * _CHAR_ALIGNMENT / _SHORT_ALIGNMENT / _INT_ALIGNMENT / _LONG_ALIGNMENT /
737c478bd9Sstevel@tonic-gate  * _LONG_LONG_ALIGNMENT / _DOUBLE_ALIGNMENT / _LONG_DOUBLE_ALIGNMENT /
747c478bd9Sstevel@tonic-gate  * _POINTER_ALIGNMENT / _FLOAT_ALIGNMENT:
757c478bd9Sstevel@tonic-gate  *	The ABI defines alignment requirements of each of the primitive
767c478bd9Sstevel@tonic-gate  *	object types.  Some, if not all, may be hardware requirements as
777c478bd9Sstevel@tonic-gate  * 	well.  The values are expressed in "byte-alignment" units.
787c478bd9Sstevel@tonic-gate  *
797c478bd9Sstevel@tonic-gate  * _MAX_ALIGNMENT:
807c478bd9Sstevel@tonic-gate  *	The most stringent alignment requirement as specified by the ABI.
817c478bd9Sstevel@tonic-gate  *	Equal to the maximum of all the above _XXX_ALIGNMENT values.
827c478bd9Sstevel@tonic-gate  *
837c478bd9Sstevel@tonic-gate  * _ALIGNMENT_REQUIRED:
847c478bd9Sstevel@tonic-gate  *	True or false (1 or 0) whether or not the hardware requires the ABI
857c478bd9Sstevel@tonic-gate  *	alignment.
867c478bd9Sstevel@tonic-gate  *
877c478bd9Sstevel@tonic-gate  * _LONG_LONG_ALIGNMENT_32
887c478bd9Sstevel@tonic-gate  *	The 32-bit ABI supported by a 64-bit kernel may have different
897c478bd9Sstevel@tonic-gate  *	alignment requirements for primitive object types.  The value of this
907c478bd9Sstevel@tonic-gate  *	identifier is expressed in "byte-alignment" units.
917c478bd9Sstevel@tonic-gate  *
927c478bd9Sstevel@tonic-gate  * _HAVE_CPUID_INSN
937c478bd9Sstevel@tonic-gate  *	This indicates that the architecture supports the 'cpuid'
947c478bd9Sstevel@tonic-gate  *	instruction as defined by Intel.  (Intel allows other vendors
957c478bd9Sstevel@tonic-gate  *	to extend the instruction for their own purposes.)
967c478bd9Sstevel@tonic-gate  *
977c478bd9Sstevel@tonic-gate  *
987c478bd9Sstevel@tonic-gate  * Implementation Choices:
997c478bd9Sstevel@tonic-gate  *
1007c478bd9Sstevel@tonic-gate  * _ILP32 / _LP64:
1017c478bd9Sstevel@tonic-gate  *	This specifies the compiler data type implementation as specified in
1027c478bd9Sstevel@tonic-gate  *	the relevant ABI.  The choice between these is strongly influenced
1037c478bd9Sstevel@tonic-gate  *	by the underlying hardware, but is not absolutely tied to it.
1047c478bd9Sstevel@tonic-gate  *	Currently only two data type models are supported:
1057c478bd9Sstevel@tonic-gate  *
1067c478bd9Sstevel@tonic-gate  *	_ILP32:
1077c478bd9Sstevel@tonic-gate  *		Int/Long/Pointer are 32 bits.  This is the historical UNIX
1087c478bd9Sstevel@tonic-gate  *		and Solaris implementation.  Due to its historical standing,
1097c478bd9Sstevel@tonic-gate  *		this is the default case.
1107c478bd9Sstevel@tonic-gate  *
1117c478bd9Sstevel@tonic-gate  *	_LP64:
1127c478bd9Sstevel@tonic-gate  *		Long/Pointer are 64 bits, Int is 32 bits.  This is the chosen
1137c478bd9Sstevel@tonic-gate  *		implementation for 64-bit ABIs such as SPARC V9.
1147c478bd9Sstevel@tonic-gate  *
1157c478bd9Sstevel@tonic-gate  *	_I32LPx:
1167c478bd9Sstevel@tonic-gate  *		A compilation environment where 'int' is 32-bit, and
1177c478bd9Sstevel@tonic-gate  *		longs and pointers are simply the same size.
1187c478bd9Sstevel@tonic-gate  *
1197c478bd9Sstevel@tonic-gate  *	In all cases, Char is 8 bits and Short is 16 bits.
1207c478bd9Sstevel@tonic-gate  *
1217c478bd9Sstevel@tonic-gate  * _SUNOS_VTOC_8 / _SUNOS_VTOC_16 / _SVR4_VTOC_16:
1227c478bd9Sstevel@tonic-gate  *	This specifies the form of the disk VTOC (or label):
1237c478bd9Sstevel@tonic-gate  *
1247c478bd9Sstevel@tonic-gate  *	_SUNOS_VTOC_8:
1257c478bd9Sstevel@tonic-gate  *		This is a VTOC form which is upwardly compatible with the
1267c478bd9Sstevel@tonic-gate  *		SunOS 4.x disk label and allows 8 partitions per disk.
1277c478bd9Sstevel@tonic-gate  *
1287c478bd9Sstevel@tonic-gate  *	_SUNOS_VTOC_16:
1297c478bd9Sstevel@tonic-gate  *		In this format the incore vtoc image matches the ondisk
1307c478bd9Sstevel@tonic-gate  *		version.  It allows 16 slices per disk, and is not
1317c478bd9Sstevel@tonic-gate  *		compatible with the SunOS 4.x disk label.
1327c478bd9Sstevel@tonic-gate  *
1337c478bd9Sstevel@tonic-gate  *	Note that these are not the only two VTOC forms possible and
1347c478bd9Sstevel@tonic-gate  *	additional forms may be added.  One possible form would be the
1357c478bd9Sstevel@tonic-gate  *	SVr4 VTOC form.  The symbol for that is reserved now, although
1367c478bd9Sstevel@tonic-gate  *	it is not implemented.
1377c478bd9Sstevel@tonic-gate  *
1387c478bd9Sstevel@tonic-gate  *	_SVR4_VTOC_16:
1397c478bd9Sstevel@tonic-gate  *		This VTOC form is compatible with the System V Release 4
1407c478bd9Sstevel@tonic-gate  *		VTOC (as implemented on the SVr4 Intel and 3b ports) with
1417c478bd9Sstevel@tonic-gate  *		16 partitions per disk.
1427c478bd9Sstevel@tonic-gate  *
1437c478bd9Sstevel@tonic-gate  *
1447c478bd9Sstevel@tonic-gate  * _DMA_USES_PHYSADDR / _DMA_USES_VIRTADDR
1457c478bd9Sstevel@tonic-gate  *	This describes the type of addresses used by system DMA:
1467c478bd9Sstevel@tonic-gate  *
1477c478bd9Sstevel@tonic-gate  *	_DMA_USES_PHYSADDR:
1487c478bd9Sstevel@tonic-gate  *		This type of DMA, used in the x86 implementation,
1497c478bd9Sstevel@tonic-gate  *		requires physical addresses for DMA buffers.  The 24-bit
1507c478bd9Sstevel@tonic-gate  *		addresses used by some legacy boards is the source of the
1517c478bd9Sstevel@tonic-gate  *		"low-memory" (<16MB) requirement for some devices using DMA.
1527c478bd9Sstevel@tonic-gate  *
1537c478bd9Sstevel@tonic-gate  *	_DMA_USES_VIRTADDR:
1547c478bd9Sstevel@tonic-gate  *		This method of DMA allows the use of virtual addresses for
1557c478bd9Sstevel@tonic-gate  *		DMA transfers.
1567c478bd9Sstevel@tonic-gate  *
1577c478bd9Sstevel@tonic-gate  * _FIRMWARE_NEEDS_FDISK / _NO_FDISK_PRESENT
1587c478bd9Sstevel@tonic-gate  *      This indicates the presence/absence of an fdisk table.
1597c478bd9Sstevel@tonic-gate  *
1607c478bd9Sstevel@tonic-gate  *      _FIRMWARE_NEEDS_FDISK
1617c478bd9Sstevel@tonic-gate  *              The fdisk table is required by system firmware.  If present,
1627c478bd9Sstevel@tonic-gate  *              it allows a disk to be subdivided into multiple fdisk
1637c478bd9Sstevel@tonic-gate  *              partitions, each of which is equivalent to a separate,
1647c478bd9Sstevel@tonic-gate  *              virtual disk.  This enables the co-existence of multiple
1657c478bd9Sstevel@tonic-gate  *              operating systems on a shared hard disk.
1667c478bd9Sstevel@tonic-gate  *
1677c478bd9Sstevel@tonic-gate  *      _NO_FDISK_PRESENT
1687c478bd9Sstevel@tonic-gate  *              If the fdisk table is absent, it is assumed that the entire
1697c478bd9Sstevel@tonic-gate  *              media is allocated for a single operating system.
1707c478bd9Sstevel@tonic-gate  *
171*fea9cb91Slq  * _HAVE_TEM_FIRMWARE
172*fea9cb91Slq  *	Defined if this architecture has the (fallback) option of
173*fea9cb91Slq  *	using prom_* calls for doing I/O if a suitable kernel driver
174*fea9cb91Slq  *	is not available to do it.
1757c478bd9Sstevel@tonic-gate  *
176*fea9cb91Slq  * _DONT_USE_1275_GENERIC_NAMES
1777c478bd9Sstevel@tonic-gate  *		Controls whether or not device tree node names should
1787c478bd9Sstevel@tonic-gate  *		comply with the IEEE 1275 "Generic Names" Recommended
1797c478bd9Sstevel@tonic-gate  *		Practice. With _DONT_USE_GENERIC_NAMES, device-specific
1807c478bd9Sstevel@tonic-gate  *		names identifying the particular device will be used.
1817c478bd9Sstevel@tonic-gate  *
1827c478bd9Sstevel@tonic-gate  * __i386_COMPAT
1837c478bd9Sstevel@tonic-gate  *	This indicates whether the i386 ABI is supported as a *non-native*
1847c478bd9Sstevel@tonic-gate  *	mode for the platform.  When this symbol is defined:
1857c478bd9Sstevel@tonic-gate  *	-	32-bit xstat-style system calls are enabled
1867c478bd9Sstevel@tonic-gate  *	-	32-bit xmknod-style system calls are enabled
1877c478bd9Sstevel@tonic-gate  *	-	32-bit system calls use i386 sizes -and- alignments
1887c478bd9Sstevel@tonic-gate  *
1897c478bd9Sstevel@tonic-gate  *	Note that this is NOT defined for the i386 native environment!
1907c478bd9Sstevel@tonic-gate  *
1917c478bd9Sstevel@tonic-gate  * __x86
1927c478bd9Sstevel@tonic-gate  *	This is ONLY a synonym for defined(__i386) || defined(__amd64)
1937c478bd9Sstevel@tonic-gate  *	which is useful only insofar as these two architectures share
1947c478bd9Sstevel@tonic-gate  *	common attributes.  Analogous to __sparc.
1957c478bd9Sstevel@tonic-gate  *
1967c478bd9Sstevel@tonic-gate  * _PSM_MODULES
1977c478bd9Sstevel@tonic-gate  *	This indicates whether or not the implementation uses PSM
1987c478bd9Sstevel@tonic-gate  *	modules for processor support, reading /etc/mach from inside
1997c478bd9Sstevel@tonic-gate  *	the kernel to extract a list.
2007c478bd9Sstevel@tonic-gate  *
2017c478bd9Sstevel@tonic-gate  * _RTC_CONFIG
2027c478bd9Sstevel@tonic-gate  *	This indicates whether or not the implementation uses /etc/rtc_config
2037c478bd9Sstevel@tonic-gate  *	to configure the real-time clock in the kernel.
2047c478bd9Sstevel@tonic-gate  */
2057c478bd9Sstevel@tonic-gate 
2067c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
2077c478bd9Sstevel@tonic-gate extern "C" {
2087c478bd9Sstevel@tonic-gate #endif
2097c478bd9Sstevel@tonic-gate 
2107c478bd9Sstevel@tonic-gate /*
2117c478bd9Sstevel@tonic-gate  * The following set of definitions characterize Solaris on AMD's
2127c478bd9Sstevel@tonic-gate  * 64-bit systems.
2137c478bd9Sstevel@tonic-gate  */
214c2e7b48dSkalai #if defined(__x86_64) || defined(__amd64)
2157c478bd9Sstevel@tonic-gate 
2167c478bd9Sstevel@tonic-gate #if !defined(__amd64)
2177c478bd9Sstevel@tonic-gate #define	__amd64		/* preferred guard */
2187c478bd9Sstevel@tonic-gate #endif
2197c478bd9Sstevel@tonic-gate 
2207c478bd9Sstevel@tonic-gate #if !defined(__x86)
2217c478bd9Sstevel@tonic-gate #define	__x86
2227c478bd9Sstevel@tonic-gate #endif
2237c478bd9Sstevel@tonic-gate 
2247c478bd9Sstevel@tonic-gate /*
2257c478bd9Sstevel@tonic-gate  * Define the appropriate "processor characteristics"
2267c478bd9Sstevel@tonic-gate  */
2277c478bd9Sstevel@tonic-gate #define	_LITTLE_ENDIAN
2287c478bd9Sstevel@tonic-gate #define	_STACK_GROWS_DOWNWARD
2297c478bd9Sstevel@tonic-gate #define	_LONG_LONG_LTOH
2307c478bd9Sstevel@tonic-gate #define	_BIT_FIELDS_LTOH
2317c478bd9Sstevel@tonic-gate #define	_IEEE_754
2327c478bd9Sstevel@tonic-gate #define	_CHAR_IS_SIGNED
2337c478bd9Sstevel@tonic-gate #define	_BOOL_ALIGNMENT			1
2347c478bd9Sstevel@tonic-gate #define	_CHAR_ALIGNMENT			1
2357c478bd9Sstevel@tonic-gate #define	_SHORT_ALIGNMENT		2
2367c478bd9Sstevel@tonic-gate #define	_INT_ALIGNMENT			4
2377c478bd9Sstevel@tonic-gate #define	_FLOAT_ALIGNMENT		4
2387c478bd9Sstevel@tonic-gate #define	_FLOAT_COMPLEX_ALIGNMENT	4
2397c478bd9Sstevel@tonic-gate #define	_LONG_ALIGNMENT			8
2407c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT		8
2417c478bd9Sstevel@tonic-gate #define	_DOUBLE_ALIGNMENT		8
2427c478bd9Sstevel@tonic-gate #define	_DOUBLE_COMPLEX_ALIGNMENT	8
2437c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_ALIGNMENT		16
2447c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	16
2457c478bd9Sstevel@tonic-gate #define	_POINTER_ALIGNMENT		8
2467c478bd9Sstevel@tonic-gate #define	_MAX_ALIGNMENT			16
2477c478bd9Sstevel@tonic-gate #define	_ALIGNMENT_REQUIRED		1
2487c478bd9Sstevel@tonic-gate 
2497c478bd9Sstevel@tonic-gate /*
2507c478bd9Sstevel@tonic-gate  * Different alignment constraints for the i386 ABI in compatibility mode
2517c478bd9Sstevel@tonic-gate  */
2527c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT_32		4
2537c478bd9Sstevel@tonic-gate 
2547c478bd9Sstevel@tonic-gate /*
2557c478bd9Sstevel@tonic-gate  * Define the appropriate "implementation choices".
2567c478bd9Sstevel@tonic-gate  */
2577c478bd9Sstevel@tonic-gate #if !defined(_LP64)
2587c478bd9Sstevel@tonic-gate #define	_LP64
2597c478bd9Sstevel@tonic-gate #endif
2607c478bd9Sstevel@tonic-gate #if !defined(_I32LPx) && defined(_KERNEL)
2617c478bd9Sstevel@tonic-gate #define	_I32LPx
2627c478bd9Sstevel@tonic-gate #endif
2637c478bd9Sstevel@tonic-gate #define	_MULTI_DATAMODEL
2647c478bd9Sstevel@tonic-gate #define	_SUNOS_VTOC_16
2657c478bd9Sstevel@tonic-gate #define	_DMA_USES_PHYSADDR
2667c478bd9Sstevel@tonic-gate #define	_FIRMWARE_NEEDS_FDISK
2677c478bd9Sstevel@tonic-gate #define	__i386_COMPAT
2687c478bd9Sstevel@tonic-gate #define	_PSM_MODULES
2697c478bd9Sstevel@tonic-gate #define	_RTC_CONFIG
2707c478bd9Sstevel@tonic-gate #define	_DONT_USE_1275_GENERIC_NAMES
2717c478bd9Sstevel@tonic-gate #define	_HAVE_CPUID_INSN
2727c478bd9Sstevel@tonic-gate 
2737c478bd9Sstevel@tonic-gate /*
2747c478bd9Sstevel@tonic-gate  * The feature test macro __i386 is generic for all processors implementing
2757c478bd9Sstevel@tonic-gate  * the Intel 386 instruction set or a superset of it.  Specifically, this
2767c478bd9Sstevel@tonic-gate  * includes all members of the 386, 486, and Pentium family of processors.
2777c478bd9Sstevel@tonic-gate  */
2787c478bd9Sstevel@tonic-gate #elif defined(__i386) || defined(__i386__)
2797c478bd9Sstevel@tonic-gate 
2807c478bd9Sstevel@tonic-gate #if !defined(__i386)
2817c478bd9Sstevel@tonic-gate #define	__i386
2827c478bd9Sstevel@tonic-gate #endif
2837c478bd9Sstevel@tonic-gate 
2847c478bd9Sstevel@tonic-gate #if !defined(__x86)
2857c478bd9Sstevel@tonic-gate #define	__x86
2867c478bd9Sstevel@tonic-gate #endif
2877c478bd9Sstevel@tonic-gate 
2887c478bd9Sstevel@tonic-gate /*
2897c478bd9Sstevel@tonic-gate  * Define the appropriate "processor characteristics"
2907c478bd9Sstevel@tonic-gate  */
2917c478bd9Sstevel@tonic-gate #define	_LITTLE_ENDIAN
2927c478bd9Sstevel@tonic-gate #define	_STACK_GROWS_DOWNWARD
2937c478bd9Sstevel@tonic-gate #define	_LONG_LONG_LTOH
2947c478bd9Sstevel@tonic-gate #define	_BIT_FIELDS_LTOH
2957c478bd9Sstevel@tonic-gate #define	_IEEE_754
2967c478bd9Sstevel@tonic-gate #define	_CHAR_IS_SIGNED
2977c478bd9Sstevel@tonic-gate #define	_BOOL_ALIGNMENT			1
2987c478bd9Sstevel@tonic-gate #define	_CHAR_ALIGNMENT			1
2997c478bd9Sstevel@tonic-gate #define	_SHORT_ALIGNMENT		2
3007c478bd9Sstevel@tonic-gate #define	_INT_ALIGNMENT			4
3017c478bd9Sstevel@tonic-gate #define	_FLOAT_ALIGNMENT		4
3027c478bd9Sstevel@tonic-gate #define	_FLOAT_COMPLEX_ALIGNMENT	4
3037c478bd9Sstevel@tonic-gate #define	_LONG_ALIGNMENT			4
3047c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT		4
3057c478bd9Sstevel@tonic-gate #define	_DOUBLE_ALIGNMENT		4
3067c478bd9Sstevel@tonic-gate #define	_DOUBLE_COMPLEX_ALIGNMENT	4
3077c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_ALIGNMENT		4
3087c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	4
3097c478bd9Sstevel@tonic-gate #define	_POINTER_ALIGNMENT		4
3107c478bd9Sstevel@tonic-gate #define	_MAX_ALIGNMENT			4
3117c478bd9Sstevel@tonic-gate #define	_ALIGNMENT_REQUIRED		0
3127c478bd9Sstevel@tonic-gate 
3137c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGNMENT
3147c478bd9Sstevel@tonic-gate 
3157c478bd9Sstevel@tonic-gate /*
3167c478bd9Sstevel@tonic-gate  * Define the appropriate "implementation choices".
3177c478bd9Sstevel@tonic-gate  */
3187c478bd9Sstevel@tonic-gate #define	_ILP32
3197c478bd9Sstevel@tonic-gate #if !defined(_I32LPx) && defined(_KERNEL)
3207c478bd9Sstevel@tonic-gate #define	_I32LPx
3217c478bd9Sstevel@tonic-gate #endif
3227c478bd9Sstevel@tonic-gate #define	_SUNOS_VTOC_16
3237c478bd9Sstevel@tonic-gate #define	_DMA_USES_PHYSADDR
3247c478bd9Sstevel@tonic-gate #define	_FIRMWARE_NEEDS_FDISK
3257c478bd9Sstevel@tonic-gate #define	_PSM_MODULES
3267c478bd9Sstevel@tonic-gate #define	_RTC_CONFIG
3277c478bd9Sstevel@tonic-gate #define	_DONT_USE_1275_GENERIC_NAMES
3287c478bd9Sstevel@tonic-gate #define	_HAVE_CPUID_INSN
3297c478bd9Sstevel@tonic-gate 
3307c478bd9Sstevel@tonic-gate /*
3317c478bd9Sstevel@tonic-gate  * The following set of definitions characterize the Solaris on SPARC systems.
3327c478bd9Sstevel@tonic-gate  *
3337c478bd9Sstevel@tonic-gate  * The symbol __sparc indicates any of the SPARC family of processor
3347c478bd9Sstevel@tonic-gate  * architectures.  This includes SPARC V7, SPARC V8 and SPARC V9.
3357c478bd9Sstevel@tonic-gate  *
3367c478bd9Sstevel@tonic-gate  * The symbol __sparcv8 indicates the 32-bit SPARC V8 architecture as defined
3377c478bd9Sstevel@tonic-gate  * by Version 8 of the SPARC Architecture Manual.  (SPARC V7 is close enough
3387c478bd9Sstevel@tonic-gate  * to SPARC V8 for the former to be subsumed into the latter definition.)
3397c478bd9Sstevel@tonic-gate  *
3407c478bd9Sstevel@tonic-gate  * The symbol __sparcv9 indicates the 64-bit SPARC V9 architecture as defined
3417c478bd9Sstevel@tonic-gate  * by Version 9 of the SPARC Architecture Manual.
3427c478bd9Sstevel@tonic-gate  *
3437c478bd9Sstevel@tonic-gate  * The symbols __sparcv8 and __sparcv9 are mutually exclusive, and are only
3447c478bd9Sstevel@tonic-gate  * relevant when the symbol __sparc is defined.
3457c478bd9Sstevel@tonic-gate  */
3467c478bd9Sstevel@tonic-gate /*
3477c478bd9Sstevel@tonic-gate  * XXX Due to the existence of 5110166, "defined(__sparcv9)" needs to be added
3487c478bd9Sstevel@tonic-gate  * to support backwards builds.  This workaround should be removed in s10_71.
3497c478bd9Sstevel@tonic-gate  */
3507c478bd9Sstevel@tonic-gate #elif defined(__sparc) || defined(__sparcv9) || defined(__sparc__)
3517c478bd9Sstevel@tonic-gate #if !defined(__sparc)
3527c478bd9Sstevel@tonic-gate #define	__sparc
3537c478bd9Sstevel@tonic-gate #endif
3547c478bd9Sstevel@tonic-gate 
3557c478bd9Sstevel@tonic-gate /*
3567c478bd9Sstevel@tonic-gate  * You can be 32-bit or 64-bit, but not both at the same time.
3577c478bd9Sstevel@tonic-gate  */
3587c478bd9Sstevel@tonic-gate #if defined(__sparcv8) && defined(__sparcv9)
3597c478bd9Sstevel@tonic-gate #error	"SPARC Versions 8 and 9 are mutually exclusive choices"
3607c478bd9Sstevel@tonic-gate #endif
3617c478bd9Sstevel@tonic-gate 
3627c478bd9Sstevel@tonic-gate /*
3637c478bd9Sstevel@tonic-gate  * Existing compilers do not set __sparcv8.  Years will transpire before
3647c478bd9Sstevel@tonic-gate  * the compilers can be depended on to set the feature test macro. In
3657c478bd9Sstevel@tonic-gate  * the interim, we'll set it here on the basis of historical behaviour;
3667c478bd9Sstevel@tonic-gate  * if you haven't asked for SPARC V9, then you must've meant SPARC V8.
3677c478bd9Sstevel@tonic-gate  */
3687c478bd9Sstevel@tonic-gate #if !defined(__sparcv9) && !defined(__sparcv8)
3697c478bd9Sstevel@tonic-gate #define	__sparcv8
3707c478bd9Sstevel@tonic-gate #endif
3717c478bd9Sstevel@tonic-gate 
3727c478bd9Sstevel@tonic-gate /*
3737c478bd9Sstevel@tonic-gate  * Define the appropriate "processor characteristics" shared between
3747c478bd9Sstevel@tonic-gate  * all Solaris on SPARC systems.
3757c478bd9Sstevel@tonic-gate  */
3767c478bd9Sstevel@tonic-gate #define	_BIG_ENDIAN
3777c478bd9Sstevel@tonic-gate #define	_STACK_GROWS_DOWNWARD
3787c478bd9Sstevel@tonic-gate #define	_LONG_LONG_HTOL
3797c478bd9Sstevel@tonic-gate #define	_BIT_FIELDS_HTOL
3807c478bd9Sstevel@tonic-gate #define	_IEEE_754
3817c478bd9Sstevel@tonic-gate #define	_CHAR_IS_SIGNED
3827c478bd9Sstevel@tonic-gate #define	_BOOL_ALIGNMENT			1
3837c478bd9Sstevel@tonic-gate #define	_CHAR_ALIGNMENT			1
3847c478bd9Sstevel@tonic-gate #define	_SHORT_ALIGNMENT		2
3857c478bd9Sstevel@tonic-gate #define	_INT_ALIGNMENT			4
3867c478bd9Sstevel@tonic-gate #define	_FLOAT_ALIGNMENT		4
3877c478bd9Sstevel@tonic-gate #define	_FLOAT_COMPLEX_ALIGNMENT	4
3887c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT		8
3897c478bd9Sstevel@tonic-gate #define	_DOUBLE_ALIGNMENT		8
3907c478bd9Sstevel@tonic-gate #define	_DOUBLE_COMPLEX_ALIGNMENT	8
3917c478bd9Sstevel@tonic-gate #define	_ALIGNMENT_REQUIRED		1
3927c478bd9Sstevel@tonic-gate 
3937c478bd9Sstevel@tonic-gate /*
3947c478bd9Sstevel@tonic-gate  * Define the appropriate "implementation choices" shared between versions.
3957c478bd9Sstevel@tonic-gate  */
3967c478bd9Sstevel@tonic-gate #define	_SUNOS_VTOC_8
3977c478bd9Sstevel@tonic-gate #define	_DMA_USES_VIRTADDR
3987c478bd9Sstevel@tonic-gate #define	_NO_FDISK_PRESENT
399*fea9cb91Slq #define	_HAVE_TEM_FIRMWARE
4007c478bd9Sstevel@tonic-gate 
4017c478bd9Sstevel@tonic-gate /*
4027c478bd9Sstevel@tonic-gate  * The following set of definitions characterize the implementation of
4037c478bd9Sstevel@tonic-gate  * 32-bit Solaris on SPARC V8 systems.
4047c478bd9Sstevel@tonic-gate  */
4057c478bd9Sstevel@tonic-gate #if defined(__sparcv8)
4067c478bd9Sstevel@tonic-gate 
4077c478bd9Sstevel@tonic-gate /*
4087c478bd9Sstevel@tonic-gate  * Define the appropriate "processor characteristics"
4097c478bd9Sstevel@tonic-gate  */
4107c478bd9Sstevel@tonic-gate #define	_LONG_ALIGNMENT			4
4117c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_ALIGNMENT		8
4127c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	8
4137c478bd9Sstevel@tonic-gate #define	_POINTER_ALIGNMENT		4
4147c478bd9Sstevel@tonic-gate #define	_MAX_ALIGNMENT			8
4157c478bd9Sstevel@tonic-gate 
4167c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGNMENT
4177c478bd9Sstevel@tonic-gate 
4187c478bd9Sstevel@tonic-gate /*
4197c478bd9Sstevel@tonic-gate  * Define the appropriate "implementation choices"
4207c478bd9Sstevel@tonic-gate  */
4217c478bd9Sstevel@tonic-gate #define	_ILP32
4227c478bd9Sstevel@tonic-gate #if !defined(_I32LPx) && defined(_KERNEL)
4237c478bd9Sstevel@tonic-gate #define	_I32LPx
4247c478bd9Sstevel@tonic-gate #endif
4257c478bd9Sstevel@tonic-gate 
4267c478bd9Sstevel@tonic-gate /*
4277c478bd9Sstevel@tonic-gate  * The following set of definitions characterize the implementation of
4287c478bd9Sstevel@tonic-gate  * 64-bit Solaris on SPARC V9 systems.
4297c478bd9Sstevel@tonic-gate  */
4307c478bd9Sstevel@tonic-gate #elif defined(__sparcv9)
4317c478bd9Sstevel@tonic-gate 
4327c478bd9Sstevel@tonic-gate /*
4337c478bd9Sstevel@tonic-gate  * Define the appropriate "processor characteristics"
4347c478bd9Sstevel@tonic-gate  */
4357c478bd9Sstevel@tonic-gate #define	_LONG_ALIGNMENT			8
4367c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_ALIGNMENT		16
4377c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	16
4387c478bd9Sstevel@tonic-gate #define	_POINTER_ALIGNMENT		8
4397c478bd9Sstevel@tonic-gate #define	_MAX_ALIGNMENT			16
4407c478bd9Sstevel@tonic-gate 
4417c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGMENT
4427c478bd9Sstevel@tonic-gate 
4437c478bd9Sstevel@tonic-gate /*
4447c478bd9Sstevel@tonic-gate  * Define the appropriate "implementation choices"
4457c478bd9Sstevel@tonic-gate  */
4467c478bd9Sstevel@tonic-gate #if !defined(_LP64)
4477c478bd9Sstevel@tonic-gate #define	_LP64
4487c478bd9Sstevel@tonic-gate #endif
4497c478bd9Sstevel@tonic-gate #if !defined(_I32LPx)
4507c478bd9Sstevel@tonic-gate #define	_I32LPx
4517c478bd9Sstevel@tonic-gate #endif
4527c478bd9Sstevel@tonic-gate #define	_MULTI_DATAMODEL
4537c478bd9Sstevel@tonic-gate 
4547c478bd9Sstevel@tonic-gate #else
4557c478bd9Sstevel@tonic-gate #error	"unknown SPARC version"
4567c478bd9Sstevel@tonic-gate #endif
4577c478bd9Sstevel@tonic-gate 
4587c478bd9Sstevel@tonic-gate /*
4597c478bd9Sstevel@tonic-gate  * #error is strictly ansi-C, but works as well as anything for K&R systems.
4607c478bd9Sstevel@tonic-gate  */
4617c478bd9Sstevel@tonic-gate #else
4627c478bd9Sstevel@tonic-gate #error "ISA not supported"
4637c478bd9Sstevel@tonic-gate #endif
4647c478bd9Sstevel@tonic-gate 
4657c478bd9Sstevel@tonic-gate #if defined(_ILP32) && defined(_LP64)
4667c478bd9Sstevel@tonic-gate #error "Both _ILP32 and _LP64 are defined"
4677c478bd9Sstevel@tonic-gate #endif
4687c478bd9Sstevel@tonic-gate 
4697c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
4707c478bd9Sstevel@tonic-gate }
4717c478bd9Sstevel@tonic-gate #endif
4727c478bd9Sstevel@tonic-gate 
4737c478bd9Sstevel@tonic-gate #endif	/* _SYS_ISA_DEFS_H */
474