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