xref: /illumos-gate/usr/src/uts/common/sys/isa_defs.h (revision fc2512cf)
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
5fea9cb91Slq  * Common Development and Distribution License (the "License").
6fea9cb91Slq  * 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  *
13ed5289f9SKen Erickson  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
237c478bd9Sstevel@tonic-gate /*
24b4b6080eSRoger A. Faulkner  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
257c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
26*fc2512cfSRobert Mustacchi  * Copyright 2016 Joyent, Inc.
277c478bd9Sstevel@tonic-gate  */
297c478bd9Sstevel@tonic-gate #ifndef	_SYS_ISA_DEFS_H
307c478bd9Sstevel@tonic-gate #define	_SYS_ISA_DEFS_H
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  *
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  *
83*fc2512cfSRobert Mustacchi  * _MAX_ALIGNMENT_TYPE:
84*fc2512cfSRobert Mustacchi  * 	The name of the C type that has the value descried in _MAX_ALIGNMENT.
85*fc2512cfSRobert Mustacchi  *
867c478bd9Sstevel@tonic-gate  * _ALIGNMENT_REQUIRED:
877c478bd9Sstevel@tonic-gate  *	True or false (1 or 0) whether or not the hardware requires the ABI
887c478bd9Sstevel@tonic-gate  *	alignment.
897c478bd9Sstevel@tonic-gate  *
907c478bd9Sstevel@tonic-gate  * _LONG_LONG_ALIGNMENT_32
917c478bd9Sstevel@tonic-gate  *	The 32-bit ABI supported by a 64-bit kernel may have different
927c478bd9Sstevel@tonic-gate  *	alignment requirements for primitive object types.  The value of this
937c478bd9Sstevel@tonic-gate  *	identifier is expressed in "byte-alignment" units.
947c478bd9Sstevel@tonic-gate  *
957c478bd9Sstevel@tonic-gate  * _HAVE_CPUID_INSN
967c478bd9Sstevel@tonic-gate  *	This indicates that the architecture supports the 'cpuid'
977c478bd9Sstevel@tonic-gate  *	instruction as defined by Intel.  (Intel allows other vendors
987c478bd9Sstevel@tonic-gate  *	to extend the instruction for their own purposes.)
997c478bd9Sstevel@tonic-gate  *
1007c478bd9Sstevel@tonic-gate  *
1017c478bd9Sstevel@tonic-gate  * Implementation Choices:
1027c478bd9Sstevel@tonic-gate  *
1037c478bd9Sstevel@tonic-gate  * _ILP32 / _LP64:
1047c478bd9Sstevel@tonic-gate  *	This specifies the compiler data type implementation as specified in
1057c478bd9Sstevel@tonic-gate  *	the relevant ABI.  The choice between these is strongly influenced
1067c478bd9Sstevel@tonic-gate  *	by the underlying hardware, but is not absolutely tied to it.
1077c478bd9Sstevel@tonic-gate  *	Currently only two data type models are supported:
1087c478bd9Sstevel@tonic-gate  *
1097c478bd9Sstevel@tonic-gate  *	_ILP32:
1107c478bd9Sstevel@tonic-gate  *		Int/Long/Pointer are 32 bits.  This is the historical UNIX
1117c478bd9Sstevel@tonic-gate  *		and Solaris implementation.  Due to its historical standing,
1127c478bd9Sstevel@tonic-gate  *		this is the default case.
1137c478bd9Sstevel@tonic-gate  *
1147c478bd9Sstevel@tonic-gate  *	_LP64:
1157c478bd9Sstevel@tonic-gate  *		Long/Pointer are 64 bits, Int is 32 bits.  This is the chosen
1167c478bd9Sstevel@tonic-gate  *		implementation for 64-bit ABIs such as SPARC V9.
1177c478bd9Sstevel@tonic-gate  *
1187c478bd9Sstevel@tonic-gate  *	_I32LPx:
1197c478bd9Sstevel@tonic-gate  *		A compilation environment where 'int' is 32-bit, and
1207c478bd9Sstevel@tonic-gate  *		longs and pointers are simply the same size.
1217c478bd9Sstevel@tonic-gate  *
1227c478bd9Sstevel@tonic-gate  *	In all cases, Char is 8 bits and Short is 16 bits.
1237c478bd9Sstevel@tonic-gate  *
1247c478bd9Sstevel@tonic-gate  * _SUNOS_VTOC_8 / _SUNOS_VTOC_16 / _SVR4_VTOC_16:
1257c478bd9Sstevel@tonic-gate  *	This specifies the form of the disk VTOC (or label):
1267c478bd9Sstevel@tonic-gate  *
1277c478bd9Sstevel@tonic-gate  *	_SUNOS_VTOC_8:
1287c478bd9Sstevel@tonic-gate  *		This is a VTOC form which is upwardly compatible with the
1297c478bd9Sstevel@tonic-gate  *		SunOS 4.x disk label and allows 8 partitions per disk.
1307c478bd9Sstevel@tonic-gate  *
1317c478bd9Sstevel@tonic-gate  *	_SUNOS_VTOC_16:
1327c478bd9Sstevel@tonic-gate  *		In this format the incore vtoc image matches the ondisk
1337c478bd9Sstevel@tonic-gate  *		version.  It allows 16 slices per disk, and is not
1347c478bd9Sstevel@tonic-gate  *		compatible with the SunOS 4.x disk label.
1357c478bd9Sstevel@tonic-gate  *
1367c478bd9Sstevel@tonic-gate  *	Note that these are not the only two VTOC forms possible and
1377c478bd9Sstevel@tonic-gate  *	additional forms may be added.  One possible form would be the
1387c478bd9Sstevel@tonic-gate  *	SVr4 VTOC form.  The symbol for that is reserved now, although
1397c478bd9Sstevel@tonic-gate  *	it is not implemented.
1407c478bd9Sstevel@tonic-gate  *
1417c478bd9Sstevel@tonic-gate  *	_SVR4_VTOC_16:
1427c478bd9Sstevel@tonic-gate  *		This VTOC form is compatible with the System V Release 4
1437c478bd9Sstevel@tonic-gate  *		VTOC (as implemented on the SVr4 Intel and 3b ports) with
1447c478bd9Sstevel@tonic-gate  *		16 partitions per disk.
1457c478bd9Sstevel@tonic-gate  *
1467c478bd9Sstevel@tonic-gate  *
1477c478bd9Sstevel@tonic-gate  * _DMA_USES_PHYSADDR / _DMA_USES_VIRTADDR
1487c478bd9Sstevel@tonic-gate  *	This describes the type of addresses used by system DMA:
1497c478bd9Sstevel@tonic-gate  *
1507c478bd9Sstevel@tonic-gate  *	_DMA_USES_PHYSADDR:
1517c478bd9Sstevel@tonic-gate  *		This type of DMA, used in the x86 implementation,
1527c478bd9Sstevel@tonic-gate  *		requires physical addresses for DMA buffers.  The 24-bit
1537c478bd9Sstevel@tonic-gate  *		addresses used by some legacy boards is the source of the
1547c478bd9Sstevel@tonic-gate  *		"low-memory" (<16MB) requirement for some devices using DMA.
1557c478bd9Sstevel@tonic-gate  *
1567c478bd9Sstevel@tonic-gate  *	_DMA_USES_VIRTADDR:
1577c478bd9Sstevel@tonic-gate  *		This method of DMA allows the use of virtual addresses for
1587c478bd9Sstevel@tonic-gate  *		DMA transfers.
1597c478bd9Sstevel@tonic-gate  *
1607c478bd9Sstevel@tonic-gate  * _FIRMWARE_NEEDS_FDISK / _NO_FDISK_PRESENT
1617c478bd9Sstevel@tonic-gate  *      This indicates the presence/absence of an fdisk table.
1627c478bd9Sstevel@tonic-gate  *
1637c478bd9Sstevel@tonic-gate  *      _FIRMWARE_NEEDS_FDISK
1647c478bd9Sstevel@tonic-gate  *              The fdisk table is required by system firmware.  If present,
1657c478bd9Sstevel@tonic-gate  *              it allows a disk to be subdivided into multiple fdisk
1667c478bd9Sstevel@tonic-gate  *              partitions, each of which is equivalent to a separate,
1677c478bd9Sstevel@tonic-gate  *              virtual disk.  This enables the co-existence of multiple
1687c478bd9Sstevel@tonic-gate  *              operating systems on a shared hard disk.
1697c478bd9Sstevel@tonic-gate  *
1707c478bd9Sstevel@tonic-gate  *      _NO_FDISK_PRESENT
1717c478bd9Sstevel@tonic-gate  *              If the fdisk table is absent, it is assumed that the entire
1727c478bd9Sstevel@tonic-gate  *              media is allocated for a single operating system.
1737c478bd9Sstevel@tonic-gate  *
174fea9cb91Slq  * _HAVE_TEM_FIRMWARE
175fea9cb91Slq  *	Defined if this architecture has the (fallback) option of
176fea9cb91Slq  *	using prom_* calls for doing I/O if a suitable kernel driver
177fea9cb91Slq  *	is not available to do it.
1787c478bd9Sstevel@tonic-gate  *
179fea9cb91Slq  * _DONT_USE_1275_GENERIC_NAMES
1807c478bd9Sstevel@tonic-gate  *		Controls whether or not device tree node names should
1817c478bd9Sstevel@tonic-gate  *		comply with the IEEE 1275 "Generic Names" Recommended
1827c478bd9Sstevel@tonic-gate  *		Practice. With _DONT_USE_GENERIC_NAMES, device-specific
1837c478bd9Sstevel@tonic-gate  *		names identifying the particular device will be used.
1847c478bd9Sstevel@tonic-gate  *
1857c478bd9Sstevel@tonic-gate  * __i386_COMPAT
1867c478bd9Sstevel@tonic-gate  *	This indicates whether the i386 ABI is supported as a *non-native*
1877c478bd9Sstevel@tonic-gate  *	mode for the platform.  When this symbol is defined:
1887c478bd9Sstevel@tonic-gate  *	-	32-bit xstat-style system calls are enabled
1897c478bd9Sstevel@tonic-gate  *	-	32-bit xmknod-style system calls are enabled
1907c478bd9Sstevel@tonic-gate  *	-	32-bit system calls use i386 sizes -and- alignments
1917c478bd9Sstevel@tonic-gate  *
1927c478bd9Sstevel@tonic-gate  *	Note that this is NOT defined for the i386 native environment!
1937c478bd9Sstevel@tonic-gate  *
1947c478bd9Sstevel@tonic-gate  * __x86
1957c478bd9Sstevel@tonic-gate  *	This is ONLY a synonym for defined(__i386) || defined(__amd64)
1967c478bd9Sstevel@tonic-gate  *	which is useful only insofar as these two architectures share
1977c478bd9Sstevel@tonic-gate  *	common attributes.  Analogous to __sparc.
1987c478bd9Sstevel@tonic-gate  *
1997c478bd9Sstevel@tonic-gate  * _PSM_MODULES
2007c478bd9Sstevel@tonic-gate  *	This indicates whether or not the implementation uses PSM
2017c478bd9Sstevel@tonic-gate  *	modules for processor support, reading /etc/mach from inside
2027c478bd9Sstevel@tonic-gate  *	the kernel to extract a list.
2037c478bd9Sstevel@tonic-gate  *
2047c478bd9Sstevel@tonic-gate  * _RTC_CONFIG
2057c478bd9Sstevel@tonic-gate  *	This indicates whether or not the implementation uses /etc/rtc_config
2067c478bd9Sstevel@tonic-gate  *	to configure the real-time clock in the kernel.
207ae115bc7Smrj  *
208ae115bc7Smrj  * _UNIX_KRTLD
209ae115bc7Smrj  *	This indicates that the implementation uses a dynamically
210ae115bc7Smrj  *	linked unix + krtld to form the core kernel image at boot
211ae115bc7Smrj  *	time, or (in the absence of this symbol) a prelinked kernel image.
212986fd29aSsetje  *
213986fd29aSsetje  * _OBP
214986fd29aSsetje  *	This indicates the firmware interface is OBP.
215ed5289f9SKen Erickson  *
216ed5289f9SKen Erickson  * _SOFT_HOSTID
217ed5289f9SKen Erickson  *	This indicates that the implementation obtains the hostid
218ed5289f9SKen Erickson  *	from the file /etc/hostid, rather than from hardware.
2197c478bd9Sstevel@tonic-gate  */
2217c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
2227c478bd9Sstevel@tonic-gate extern "C" {
2237c478bd9Sstevel@tonic-gate #endif
2257c478bd9Sstevel@tonic-gate /*
2267c478bd9Sstevel@tonic-gate  * The following set of definitions characterize Solaris on AMD's
2277c478bd9Sstevel@tonic-gate  * 64-bit systems.
2287c478bd9Sstevel@tonic-gate  */
229c2e7b48dSkalai #if defined(__x86_64) || defined(__amd64)
2317c478bd9Sstevel@tonic-gate #if !defined(__amd64)
2327c478bd9Sstevel@tonic-gate #define	__amd64		/* preferred guard */
2337c478bd9Sstevel@tonic-gate #endif
2357c478bd9Sstevel@tonic-gate #if !defined(__x86)
2367c478bd9Sstevel@tonic-gate #define	__x86
2377c478bd9Sstevel@tonic-gate #endif
2397c478bd9Sstevel@tonic-gate /*
2407c478bd9Sstevel@tonic-gate  * Define the appropriate "processor characteristics"
2417c478bd9Sstevel@tonic-gate  */
2427c478bd9Sstevel@tonic-gate #define	_LITTLE_ENDIAN
2437c478bd9Sstevel@tonic-gate #define	_STACK_GROWS_DOWNWARD
2447c478bd9Sstevel@tonic-gate #define	_LONG_LONG_LTOH
2457c478bd9Sstevel@tonic-gate #define	_BIT_FIELDS_LTOH
2467c478bd9Sstevel@tonic-gate #define	_IEEE_754
2477c478bd9Sstevel@tonic-gate #define	_CHAR_IS_SIGNED
2487c478bd9Sstevel@tonic-gate #define	_BOOL_ALIGNMENT			1
2497c478bd9Sstevel@tonic-gate #define	_CHAR_ALIGNMENT			1
2507c478bd9Sstevel@tonic-gate #define	_SHORT_ALIGNMENT		2
2517c478bd9Sstevel@tonic-gate #define	_INT_ALIGNMENT			4
2527c478bd9Sstevel@tonic-gate #define	_FLOAT_ALIGNMENT		4
2537c478bd9Sstevel@tonic-gate #define	_FLOAT_COMPLEX_ALIGNMENT	4
2547c478bd9Sstevel@tonic-gate #define	_LONG_ALIGNMENT			8
2557c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT		8
2567c478bd9Sstevel@tonic-gate #define	_DOUBLE_ALIGNMENT		8
2577c478bd9Sstevel@tonic-gate #define	_DOUBLE_COMPLEX_ALIGNMENT	8
2587c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_ALIGNMENT		16
2597c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	16
2607c478bd9Sstevel@tonic-gate #define	_POINTER_ALIGNMENT		8
2617c478bd9Sstevel@tonic-gate #define	_MAX_ALIGNMENT			16
2627c478bd9Sstevel@tonic-gate #define	_ALIGNMENT_REQUIRED		1
263*fc2512cfSRobert Mustacchi #define	_MAX_ALIGNMENT_TYPE		long double
2657c478bd9Sstevel@tonic-gate /*
2667c478bd9Sstevel@tonic-gate  * Different alignment constraints for the i386 ABI in compatibility mode
2677c478bd9Sstevel@tonic-gate  */
2687c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT_32		4
2707c478bd9Sstevel@tonic-gate /*
2717c478bd9Sstevel@tonic-gate  * Define the appropriate "implementation choices".
2727c478bd9Sstevel@tonic-gate  */
2737c478bd9Sstevel@tonic-gate #if !defined(_LP64)
2747c478bd9Sstevel@tonic-gate #define	_LP64
2757c478bd9Sstevel@tonic-gate #endif
2767c478bd9Sstevel@tonic-gate #if !defined(_I32LPx) && defined(_KERNEL)
2777c478bd9Sstevel@tonic-gate #define	_I32LPx
2787c478bd9Sstevel@tonic-gate #endif
2797c478bd9Sstevel@tonic-gate #define	_MULTI_DATAMODEL
2807c478bd9Sstevel@tonic-gate #define	_SUNOS_VTOC_16
2817c478bd9Sstevel@tonic-gate #define	_DMA_USES_PHYSADDR
2827c478bd9Sstevel@tonic-gate #define	_FIRMWARE_NEEDS_FDISK
2837c478bd9Sstevel@tonic-gate #define	__i386_COMPAT
2847c478bd9Sstevel@tonic-gate #define	_PSM_MODULES
2857c478bd9Sstevel@tonic-gate #define	_RTC_CONFIG
286ed5289f9SKen Erickson #define	_SOFT_HOSTID
2877c478bd9Sstevel@tonic-gate #define	_DONT_USE_1275_GENERIC_NAMES
2887c478bd9Sstevel@tonic-gate #define	_HAVE_CPUID_INSN
2907c478bd9Sstevel@tonic-gate /*
2917c478bd9Sstevel@tonic-gate  * The feature test macro __i386 is generic for all processors implementing
2927c478bd9Sstevel@tonic-gate  * the Intel 386 instruction set or a superset of it.  Specifically, this
2937c478bd9Sstevel@tonic-gate  * includes all members of the 386, 486, and Pentium family of processors.
2947c478bd9Sstevel@tonic-gate  */
2957c478bd9Sstevel@tonic-gate #elif defined(__i386) || defined(__i386__)
2977c478bd9Sstevel@tonic-gate #if !defined(__i386)
2987c478bd9Sstevel@tonic-gate #define	__i386
2997c478bd9Sstevel@tonic-gate #endif
3017c478bd9Sstevel@tonic-gate #if !defined(__x86)
3027c478bd9Sstevel@tonic-gate #define	__x86
3037c478bd9Sstevel@tonic-gate #endif
3057c478bd9Sstevel@tonic-gate /*
3067c478bd9Sstevel@tonic-gate  * Define the appropriate "processor characteristics"
3077c478bd9Sstevel@tonic-gate  */
3087c478bd9Sstevel@tonic-gate #define	_LITTLE_ENDIAN
3097c478bd9Sstevel@tonic-gate #define	_STACK_GROWS_DOWNWARD
3107c478bd9Sstevel@tonic-gate #define	_LONG_LONG_LTOH
3117c478bd9Sstevel@tonic-gate #define	_BIT_FIELDS_LTOH
3127c478bd9Sstevel@tonic-gate #define	_IEEE_754
3137c478bd9Sstevel@tonic-gate #define	_CHAR_IS_SIGNED
3147c478bd9Sstevel@tonic-gate #define	_BOOL_ALIGNMENT			1
3157c478bd9Sstevel@tonic-gate #define	_CHAR_ALIGNMENT			1
3167c478bd9Sstevel@tonic-gate #define	_SHORT_ALIGNMENT		2
3177c478bd9Sstevel@tonic-gate #define	_INT_ALIGNMENT			4
3187c478bd9Sstevel@tonic-gate #define	_FLOAT_ALIGNMENT		4
3197c478bd9Sstevel@tonic-gate #define	_FLOAT_COMPLEX_ALIGNMENT	4
3207c478bd9Sstevel@tonic-gate #define	_LONG_ALIGNMENT			4
3217c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT		4
3227c478bd9Sstevel@tonic-gate #define	_DOUBLE_ALIGNMENT		4
3237c478bd9Sstevel@tonic-gate #define	_DOUBLE_COMPLEX_ALIGNMENT	4
3247c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_ALIGNMENT		4
3257c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	4
3267c478bd9Sstevel@tonic-gate #define	_POINTER_ALIGNMENT		4
3277c478bd9Sstevel@tonic-gate #define	_MAX_ALIGNMENT			4
3287c478bd9Sstevel@tonic-gate #define	_ALIGNMENT_REQUIRED		0
329*fc2512cfSRobert Mustacchi #define	_MAX_ALIGNMENT_TYPE		long
3317c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGNMENT
3337c478bd9Sstevel@tonic-gate /*
3347c478bd9Sstevel@tonic-gate  * Define the appropriate "implementation choices".
3357c478bd9Sstevel@tonic-gate  */
336d643a855SYuri Pankov #if !defined(_ILP32)
3377c478bd9Sstevel@tonic-gate #define	_ILP32
338d643a855SYuri Pankov #endif
3397c478bd9Sstevel@tonic-gate #if !defined(_I32LPx) && defined(_KERNEL)
3407c478bd9Sstevel@tonic-gate #define	_I32LPx
3417c478bd9Sstevel@tonic-gate #endif
3427c478bd9Sstevel@tonic-gate #define	_SUNOS_VTOC_16
3437c478bd9Sstevel@tonic-gate #define	_DMA_USES_PHYSADDR
3447c478bd9Sstevel@tonic-gate #define	_FIRMWARE_NEEDS_FDISK
3457c478bd9Sstevel@tonic-gate #define	_PSM_MODULES
3467c478bd9Sstevel@tonic-gate #define	_RTC_CONFIG
347ed5289f9SKen Erickson #define	_SOFT_HOSTID
3487c478bd9Sstevel@tonic-gate #define	_DONT_USE_1275_GENERIC_NAMES
3497c478bd9Sstevel@tonic-gate #define	_HAVE_CPUID_INSN
3517c478bd9Sstevel@tonic-gate /*
3527c478bd9Sstevel@tonic-gate  * The following set of definitions characterize the Solaris on SPARC systems.
3537c478bd9Sstevel@tonic-gate  *
3547c478bd9Sstevel@tonic-gate  * The symbol __sparc indicates any of the SPARC family of processor
3557c478bd9Sstevel@tonic-gate  * architectures.  This includes SPARC V7, SPARC V8 and SPARC V9.
3567c478bd9Sstevel@tonic-gate  *
3577c478bd9Sstevel@tonic-gate  * The symbol __sparcv8 indicates the 32-bit SPARC V8 architecture as defined
3587c478bd9Sstevel@tonic-gate  * by Version 8 of the SPARC Architecture Manual.  (SPARC V7 is close enough
3597c478bd9Sstevel@tonic-gate  * to SPARC V8 for the former to be subsumed into the latter definition.)
3607c478bd9Sstevel@tonic-gate  *
3617c478bd9Sstevel@tonic-gate  * The symbol __sparcv9 indicates the 64-bit SPARC V9 architecture as defined
3627c478bd9Sstevel@tonic-gate  * by Version 9 of the SPARC Architecture Manual.
3637c478bd9Sstevel@tonic-gate  *
3647c478bd9Sstevel@tonic-gate  * The symbols __sparcv8 and __sparcv9 are mutually exclusive, and are only
3657c478bd9Sstevel@tonic-gate  * relevant when the symbol __sparc is defined.
3667c478bd9Sstevel@tonic-gate  */
3677c478bd9Sstevel@tonic-gate /*
3687c478bd9Sstevel@tonic-gate  * XXX Due to the existence of 5110166, "defined(__sparcv9)" needs to be added
3697c478bd9Sstevel@tonic-gate  * to support backwards builds.  This workaround should be removed in s10_71.
3707c478bd9Sstevel@tonic-gate  */
3717c478bd9Sstevel@tonic-gate #elif defined(__sparc) || defined(__sparcv9) || defined(__sparc__)
3727c478bd9Sstevel@tonic-gate #if !defined(__sparc)
3737c478bd9Sstevel@tonic-gate #define	__sparc
3747c478bd9Sstevel@tonic-gate #endif
3767c478bd9Sstevel@tonic-gate /*
3777c478bd9Sstevel@tonic-gate  * You can be 32-bit or 64-bit, but not both at the same time.
3787c478bd9Sstevel@tonic-gate  */
3797c478bd9Sstevel@tonic-gate #if defined(__sparcv8) && defined(__sparcv9)
3807c478bd9Sstevel@tonic-gate #error	"SPARC Versions 8 and 9 are mutually exclusive choices"
3817c478bd9Sstevel@tonic-gate #endif
3837c478bd9Sstevel@tonic-gate /*
3847c478bd9Sstevel@tonic-gate  * Existing compilers do not set __sparcv8.  Years will transpire before
3857c478bd9Sstevel@tonic-gate  * the compilers can be depended on to set the feature test macro. In
3867c478bd9Sstevel@tonic-gate  * the interim, we'll set it here on the basis of historical behaviour;
3877c478bd9Sstevel@tonic-gate  * if you haven't asked for SPARC V9, then you must've meant SPARC V8.
3887c478bd9Sstevel@tonic-gate  */
3897c478bd9Sstevel@tonic-gate #if !defined(__sparcv9) && !defined(__sparcv8)
3907c478bd9Sstevel@tonic-gate #define	__sparcv8
3917c478bd9Sstevel@tonic-gate #endif
3937c478bd9Sstevel@tonic-gate /*
3947c478bd9Sstevel@tonic-gate  * Define the appropriate "processor characteristics" shared between
3957c478bd9Sstevel@tonic-gate  * all Solaris on SPARC systems.
3967c478bd9Sstevel@tonic-gate  */
3977c478bd9Sstevel@tonic-gate #define	_BIG_ENDIAN
3987c478bd9Sstevel@tonic-gate #define	_STACK_GROWS_DOWNWARD
3997c478bd9Sstevel@tonic-gate #define	_LONG_LONG_HTOL
4007c478bd9Sstevel@tonic-gate #define	_BIT_FIELDS_HTOL
4017c478bd9Sstevel@tonic-gate #define	_IEEE_754
4027c478bd9Sstevel@tonic-gate #define	_CHAR_IS_SIGNED
4037c478bd9Sstevel@tonic-gate #define	_BOOL_ALIGNMENT			1
4047c478bd9Sstevel@tonic-gate #define	_CHAR_ALIGNMENT			1
4057c478bd9Sstevel@tonic-gate #define	_SHORT_ALIGNMENT		2
4067c478bd9Sstevel@tonic-gate #define	_INT_ALIGNMENT			4
4077c478bd9Sstevel@tonic-gate #define	_FLOAT_ALIGNMENT		4
4087c478bd9Sstevel@tonic-gate #define	_FLOAT_COMPLEX_ALIGNMENT	4
4097c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT		8
4107c478bd9Sstevel@tonic-gate #define	_DOUBLE_ALIGNMENT		8
4117c478bd9Sstevel@tonic-gate #define	_DOUBLE_COMPLEX_ALIGNMENT	8
4127c478bd9Sstevel@tonic-gate #define	_ALIGNMENT_REQUIRED		1
4147c478bd9Sstevel@tonic-gate /*
4157c478bd9Sstevel@tonic-gate  * Define the appropriate "implementation choices" shared between versions.
4167c478bd9Sstevel@tonic-gate  */
4177c478bd9Sstevel@tonic-gate #define	_SUNOS_VTOC_8
4187c478bd9Sstevel@tonic-gate #define	_DMA_USES_VIRTADDR
4197c478bd9Sstevel@tonic-gate #define	_NO_FDISK_PRESENT
420fea9cb91Slq #define	_HAVE_TEM_FIRMWARE
421986fd29aSsetje #define	_OBP
4237c478bd9Sstevel@tonic-gate /*
4247c478bd9Sstevel@tonic-gate  * The following set of definitions characterize the implementation of
4257c478bd9Sstevel@tonic-gate  * 32-bit Solaris on SPARC V8 systems.
4267c478bd9Sstevel@tonic-gate  */
4277c478bd9Sstevel@tonic-gate #if defined(__sparcv8)
4297c478bd9Sstevel@tonic-gate /*
4307c478bd9Sstevel@tonic-gate  * Define the appropriate "processor characteristics"
4317c478bd9Sstevel@tonic-gate  */
4327c478bd9Sstevel@tonic-gate #define	_LONG_ALIGNMENT			4
4337c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_ALIGNMENT		8
4347c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	8
4357c478bd9Sstevel@tonic-gate #define	_POINTER_ALIGNMENT		4
4367c478bd9Sstevel@tonic-gate #define	_MAX_ALIGNMENT			8
437*fc2512cfSRobert Mustacchi #define	_MAX_ALIGNMENT_TYPE		long double
4397c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGNMENT
4417c478bd9Sstevel@tonic-gate /*
4427c478bd9Sstevel@tonic-gate  * Define the appropriate "implementation choices"
4437c478bd9Sstevel@tonic-gate  */
444d643a855SYuri Pankov #if !defined(_ILP32)
4457c478bd9Sstevel@tonic-gate #define	_ILP32
446d643a855SYuri Pankov #endif
4477c478bd9Sstevel@tonic-gate #if !defined(_I32LPx) && defined(_KERNEL)
4487c478bd9Sstevel@tonic-gate #define	_I32LPx
4497c478bd9Sstevel@tonic-gate #endif
4517c478bd9Sstevel@tonic-gate /*
4527c478bd9Sstevel@tonic-gate  * The following set of definitions characterize the implementation of
4537c478bd9Sstevel@tonic-gate  * 64-bit Solaris on SPARC V9 systems.
4547c478bd9Sstevel@tonic-gate  */
4557c478bd9Sstevel@tonic-gate #elif defined(__sparcv9)
4577c478bd9Sstevel@tonic-gate /*
4587c478bd9Sstevel@tonic-gate  * Define the appropriate "processor characteristics"
4597c478bd9Sstevel@tonic-gate  */
4607c478bd9Sstevel@tonic-gate #define	_LONG_ALIGNMENT			8
4617c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_ALIGNMENT		16
4627c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	16
4637c478bd9Sstevel@tonic-gate #define	_POINTER_ALIGNMENT		8
4647c478bd9Sstevel@tonic-gate #define	_MAX_ALIGNMENT			16
465*fc2512cfSRobert Mustacchi #define	_MAX_ALIGNMENT_TYPE		long double
467b4b6080eSRoger A. Faulkner #define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGNMENT
4697c478bd9Sstevel@tonic-gate /*
4707c478bd9Sstevel@tonic-gate  * Define the appropriate "implementation choices"
4717c478bd9Sstevel@tonic-gate  */
4727c478bd9Sstevel@tonic-gate #if !defined(_LP64)
4737c478bd9Sstevel@tonic-gate #define	_LP64
4747c478bd9Sstevel@tonic-gate #endif
4757c478bd9Sstevel@tonic-gate #if !defined(_I32LPx)
4767c478bd9Sstevel@tonic-gate #define	_I32LPx
4777c478bd9Sstevel@tonic-gate #endif
4787c478bd9Sstevel@tonic-gate #define	_MULTI_DATAMODEL
4807c478bd9Sstevel@tonic-gate #else
4817c478bd9Sstevel@tonic-gate #error	"unknown SPARC version"
4827c478bd9Sstevel@tonic-gate #endif
4847c478bd9Sstevel@tonic-gate /*
4857c478bd9Sstevel@tonic-gate  * #error is strictly ansi-C, but works as well as anything for K&R systems.
4867c478bd9Sstevel@tonic-gate  */
4877c478bd9Sstevel@tonic-gate #else
4887c478bd9Sstevel@tonic-gate #error "ISA not supported"
4897c478bd9Sstevel@tonic-gate #endif
4917c478bd9Sstevel@tonic-gate #if defined(_ILP32) && defined(_LP64)
4927c478bd9Sstevel@tonic-gate #error "Both _ILP32 and _LP64 are defined"
4937c478bd9Sstevel@tonic-gate #endif
4957c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
4967c478bd9Sstevel@tonic-gate }
4977c478bd9Sstevel@tonic-gate #endif
4997c478bd9Sstevel@tonic-gate #endif	/* _SYS_ISA_DEFS_H */