xref: /titanic_44/usr/src/uts/common/sys/isa_defs.h (revision d1c5dc47e23888b05d4095e8983ccf62acbc69fa)
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
5fea9cb91Slq150181  * Common Development and Distribution License (the "License").
6fea9cb91Slq150181  * 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  */
22fea9cb91Slq150181 
237c478bd9Sstevel@tonic-gate /*
24b4b6080eSRoger A. Faulkner  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
257c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
26*d1c5dc47SRobert Mustacchi  * Copyright 2016 Joyent, Inc.
277c478bd9Sstevel@tonic-gate  */
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #ifndef	_SYS_ISA_DEFS_H
307c478bd9Sstevel@tonic-gate #define	_SYS_ISA_DEFS_H
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  *
83*d1c5dc47SRobert Mustacchi  * _MAX_ALIGNMENT_TYPE:
84*d1c5dc47SRobert Mustacchi  * 	The name of the C type that has the value descried in _MAX_ALIGNMENT.
85*d1c5dc47SRobert 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  *
174fea9cb91Slq150181  * _HAVE_TEM_FIRMWARE
175fea9cb91Slq150181  *	Defined if this architecture has the (fallback) option of
176fea9cb91Slq150181  *	using prom_* calls for doing I/O if a suitable kernel driver
177fea9cb91Slq150181  *	is not available to do it.
1787c478bd9Sstevel@tonic-gate  *
1797c478bd9Sstevel@tonic-gate  * _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  */
2207c478bd9Sstevel@tonic-gate 
2217c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
2227c478bd9Sstevel@tonic-gate extern "C" {
2237c478bd9Sstevel@tonic-gate #endif
2247c478bd9Sstevel@tonic-gate 
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)
2307c478bd9Sstevel@tonic-gate 
2317c478bd9Sstevel@tonic-gate #if !defined(__amd64)
2327c478bd9Sstevel@tonic-gate #define	__amd64		/* preferred guard */
2337c478bd9Sstevel@tonic-gate #endif
2347c478bd9Sstevel@tonic-gate 
2357c478bd9Sstevel@tonic-gate #if !defined(__x86)
2367c478bd9Sstevel@tonic-gate #define	__x86
2377c478bd9Sstevel@tonic-gate #endif
2387c478bd9Sstevel@tonic-gate 
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*d1c5dc47SRobert Mustacchi #define	_MAX_ALIGNMENT_TYPE		long double
2647c478bd9Sstevel@tonic-gate 
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
2697c478bd9Sstevel@tonic-gate 
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
2897c478bd9Sstevel@tonic-gate 
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__)
2967c478bd9Sstevel@tonic-gate 
2977c478bd9Sstevel@tonic-gate #if !defined(__i386)
2987c478bd9Sstevel@tonic-gate #define	__i386
2997c478bd9Sstevel@tonic-gate #endif
3007c478bd9Sstevel@tonic-gate 
3017c478bd9Sstevel@tonic-gate #if !defined(__x86)
3027c478bd9Sstevel@tonic-gate #define	__x86
3037c478bd9Sstevel@tonic-gate #endif
3047c478bd9Sstevel@tonic-gate 
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*d1c5dc47SRobert Mustacchi #define	_MAX_ALIGNMENT_TYPE		long
3307c478bd9Sstevel@tonic-gate 
3317c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGNMENT
3327c478bd9Sstevel@tonic-gate 
3337c478bd9Sstevel@tonic-gate /*
3347c478bd9Sstevel@tonic-gate  * Define the appropriate "implementation choices".
3357c478bd9Sstevel@tonic-gate  */
3367c478bd9Sstevel@tonic-gate #define	_ILP32
3377c478bd9Sstevel@tonic-gate #if !defined(_I32LPx) && defined(_KERNEL)
3387c478bd9Sstevel@tonic-gate #define	_I32LPx
3397c478bd9Sstevel@tonic-gate #endif
3407c478bd9Sstevel@tonic-gate #define	_SUNOS_VTOC_16
3417c478bd9Sstevel@tonic-gate #define	_DMA_USES_PHYSADDR
3427c478bd9Sstevel@tonic-gate #define	_FIRMWARE_NEEDS_FDISK
3437c478bd9Sstevel@tonic-gate #define	_PSM_MODULES
3447c478bd9Sstevel@tonic-gate #define	_RTC_CONFIG
345ed5289f9SKen Erickson #define	_SOFT_HOSTID
3467c478bd9Sstevel@tonic-gate #define	_DONT_USE_1275_GENERIC_NAMES
3477c478bd9Sstevel@tonic-gate #define	_HAVE_CPUID_INSN
3487c478bd9Sstevel@tonic-gate 
3497c478bd9Sstevel@tonic-gate /*
3507c478bd9Sstevel@tonic-gate  * The following set of definitions characterize the Solaris on SPARC systems.
3517c478bd9Sstevel@tonic-gate  *
3527c478bd9Sstevel@tonic-gate  * The symbol __sparc indicates any of the SPARC family of processor
3537c478bd9Sstevel@tonic-gate  * architectures.  This includes SPARC V7, SPARC V8 and SPARC V9.
3547c478bd9Sstevel@tonic-gate  *
3557c478bd9Sstevel@tonic-gate  * The symbol __sparcv8 indicates the 32-bit SPARC V8 architecture as defined
3567c478bd9Sstevel@tonic-gate  * by Version 8 of the SPARC Architecture Manual.  (SPARC V7 is close enough
3577c478bd9Sstevel@tonic-gate  * to SPARC V8 for the former to be subsumed into the latter definition.)
3587c478bd9Sstevel@tonic-gate  *
3597c478bd9Sstevel@tonic-gate  * The symbol __sparcv9 indicates the 64-bit SPARC V9 architecture as defined
3607c478bd9Sstevel@tonic-gate  * by Version 9 of the SPARC Architecture Manual.
3617c478bd9Sstevel@tonic-gate  *
3627c478bd9Sstevel@tonic-gate  * The symbols __sparcv8 and __sparcv9 are mutually exclusive, and are only
3637c478bd9Sstevel@tonic-gate  * relevant when the symbol __sparc is defined.
3647c478bd9Sstevel@tonic-gate  */
3657c478bd9Sstevel@tonic-gate /*
3667c478bd9Sstevel@tonic-gate  * XXX Due to the existence of 5110166, "defined(__sparcv9)" needs to be added
3677c478bd9Sstevel@tonic-gate  * to support backwards builds.  This workaround should be removed in s10_71.
3687c478bd9Sstevel@tonic-gate  */
3697c478bd9Sstevel@tonic-gate #elif defined(__sparc) || defined(__sparcv9) || defined(__sparc__)
3707c478bd9Sstevel@tonic-gate #if !defined(__sparc)
3717c478bd9Sstevel@tonic-gate #define	__sparc
3727c478bd9Sstevel@tonic-gate #endif
3737c478bd9Sstevel@tonic-gate 
3747c478bd9Sstevel@tonic-gate /*
3757c478bd9Sstevel@tonic-gate  * You can be 32-bit or 64-bit, but not both at the same time.
3767c478bd9Sstevel@tonic-gate  */
3777c478bd9Sstevel@tonic-gate #if defined(__sparcv8) && defined(__sparcv9)
3787c478bd9Sstevel@tonic-gate #error	"SPARC Versions 8 and 9 are mutually exclusive choices"
3797c478bd9Sstevel@tonic-gate #endif
3807c478bd9Sstevel@tonic-gate 
3817c478bd9Sstevel@tonic-gate /*
3827c478bd9Sstevel@tonic-gate  * Existing compilers do not set __sparcv8.  Years will transpire before
3837c478bd9Sstevel@tonic-gate  * the compilers can be depended on to set the feature test macro. In
3847c478bd9Sstevel@tonic-gate  * the interim, we'll set it here on the basis of historical behaviour;
3857c478bd9Sstevel@tonic-gate  * if you haven't asked for SPARC V9, then you must've meant SPARC V8.
3867c478bd9Sstevel@tonic-gate  */
3877c478bd9Sstevel@tonic-gate #if !defined(__sparcv9) && !defined(__sparcv8)
3887c478bd9Sstevel@tonic-gate #define	__sparcv8
3897c478bd9Sstevel@tonic-gate #endif
3907c478bd9Sstevel@tonic-gate 
3917c478bd9Sstevel@tonic-gate /*
3927c478bd9Sstevel@tonic-gate  * Define the appropriate "processor characteristics" shared between
3937c478bd9Sstevel@tonic-gate  * all Solaris on SPARC systems.
3947c478bd9Sstevel@tonic-gate  */
3957c478bd9Sstevel@tonic-gate #define	_BIG_ENDIAN
3967c478bd9Sstevel@tonic-gate #define	_STACK_GROWS_DOWNWARD
3977c478bd9Sstevel@tonic-gate #define	_LONG_LONG_HTOL
3987c478bd9Sstevel@tonic-gate #define	_BIT_FIELDS_HTOL
3997c478bd9Sstevel@tonic-gate #define	_IEEE_754
4007c478bd9Sstevel@tonic-gate #define	_CHAR_IS_SIGNED
4017c478bd9Sstevel@tonic-gate #define	_BOOL_ALIGNMENT			1
4027c478bd9Sstevel@tonic-gate #define	_CHAR_ALIGNMENT			1
4037c478bd9Sstevel@tonic-gate #define	_SHORT_ALIGNMENT		2
4047c478bd9Sstevel@tonic-gate #define	_INT_ALIGNMENT			4
4057c478bd9Sstevel@tonic-gate #define	_FLOAT_ALIGNMENT		4
4067c478bd9Sstevel@tonic-gate #define	_FLOAT_COMPLEX_ALIGNMENT	4
4077c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT		8
4087c478bd9Sstevel@tonic-gate #define	_DOUBLE_ALIGNMENT		8
4097c478bd9Sstevel@tonic-gate #define	_DOUBLE_COMPLEX_ALIGNMENT	8
4107c478bd9Sstevel@tonic-gate #define	_ALIGNMENT_REQUIRED		1
4117c478bd9Sstevel@tonic-gate 
4127c478bd9Sstevel@tonic-gate /*
4137c478bd9Sstevel@tonic-gate  * Define the appropriate "implementation choices" shared between versions.
4147c478bd9Sstevel@tonic-gate  */
4157c478bd9Sstevel@tonic-gate #define	_SUNOS_VTOC_8
4167c478bd9Sstevel@tonic-gate #define	_DMA_USES_VIRTADDR
4177c478bd9Sstevel@tonic-gate #define	_NO_FDISK_PRESENT
418fea9cb91Slq150181 #define	_HAVE_TEM_FIRMWARE
419986fd29aSsetje #define	_OBP
4207c478bd9Sstevel@tonic-gate 
4217c478bd9Sstevel@tonic-gate /*
4227c478bd9Sstevel@tonic-gate  * The following set of definitions characterize the implementation of
4237c478bd9Sstevel@tonic-gate  * 32-bit Solaris on SPARC V8 systems.
4247c478bd9Sstevel@tonic-gate  */
4257c478bd9Sstevel@tonic-gate #if defined(__sparcv8)
4267c478bd9Sstevel@tonic-gate 
4277c478bd9Sstevel@tonic-gate /*
4287c478bd9Sstevel@tonic-gate  * Define the appropriate "processor characteristics"
4297c478bd9Sstevel@tonic-gate  */
4307c478bd9Sstevel@tonic-gate #define	_LONG_ALIGNMENT			4
4317c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_ALIGNMENT		8
4327c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	8
4337c478bd9Sstevel@tonic-gate #define	_POINTER_ALIGNMENT		4
4347c478bd9Sstevel@tonic-gate #define	_MAX_ALIGNMENT			8
435*d1c5dc47SRobert Mustacchi #define	_MAX_ALIGNMENT_TYPE		long double
4367c478bd9Sstevel@tonic-gate 
4377c478bd9Sstevel@tonic-gate #define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGNMENT
4387c478bd9Sstevel@tonic-gate 
4397c478bd9Sstevel@tonic-gate /*
4407c478bd9Sstevel@tonic-gate  * Define the appropriate "implementation choices"
4417c478bd9Sstevel@tonic-gate  */
4427c478bd9Sstevel@tonic-gate #define	_ILP32
4437c478bd9Sstevel@tonic-gate #if !defined(_I32LPx) && defined(_KERNEL)
4447c478bd9Sstevel@tonic-gate #define	_I32LPx
4457c478bd9Sstevel@tonic-gate #endif
4467c478bd9Sstevel@tonic-gate 
4477c478bd9Sstevel@tonic-gate /*
4487c478bd9Sstevel@tonic-gate  * The following set of definitions characterize the implementation of
4497c478bd9Sstevel@tonic-gate  * 64-bit Solaris on SPARC V9 systems.
4507c478bd9Sstevel@tonic-gate  */
4517c478bd9Sstevel@tonic-gate #elif defined(__sparcv9)
4527c478bd9Sstevel@tonic-gate 
4537c478bd9Sstevel@tonic-gate /*
4547c478bd9Sstevel@tonic-gate  * Define the appropriate "processor characteristics"
4557c478bd9Sstevel@tonic-gate  */
4567c478bd9Sstevel@tonic-gate #define	_LONG_ALIGNMENT			8
4577c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_ALIGNMENT		16
4587c478bd9Sstevel@tonic-gate #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	16
4597c478bd9Sstevel@tonic-gate #define	_POINTER_ALIGNMENT		8
4607c478bd9Sstevel@tonic-gate #define	_MAX_ALIGNMENT			16
461*d1c5dc47SRobert Mustacchi #define	_MAX_ALIGNMENT_TYPE		long double
4627c478bd9Sstevel@tonic-gate 
463b4b6080eSRoger A. Faulkner #define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGNMENT
4647c478bd9Sstevel@tonic-gate 
4657c478bd9Sstevel@tonic-gate /*
4667c478bd9Sstevel@tonic-gate  * Define the appropriate "implementation choices"
4677c478bd9Sstevel@tonic-gate  */
4687c478bd9Sstevel@tonic-gate #if !defined(_LP64)
4697c478bd9Sstevel@tonic-gate #define	_LP64
4707c478bd9Sstevel@tonic-gate #endif
4717c478bd9Sstevel@tonic-gate #if !defined(_I32LPx)
4727c478bd9Sstevel@tonic-gate #define	_I32LPx
4737c478bd9Sstevel@tonic-gate #endif
4747c478bd9Sstevel@tonic-gate #define	_MULTI_DATAMODEL
4757c478bd9Sstevel@tonic-gate 
4767c478bd9Sstevel@tonic-gate #else
4777c478bd9Sstevel@tonic-gate #error	"unknown SPARC version"
4787c478bd9Sstevel@tonic-gate #endif
4797c478bd9Sstevel@tonic-gate 
4807c478bd9Sstevel@tonic-gate /*
4817c478bd9Sstevel@tonic-gate  * #error is strictly ansi-C, but works as well as anything for K&R systems.
4827c478bd9Sstevel@tonic-gate  */
4837c478bd9Sstevel@tonic-gate #else
4847c478bd9Sstevel@tonic-gate #error "ISA not supported"
4857c478bd9Sstevel@tonic-gate #endif
4867c478bd9Sstevel@tonic-gate 
4877c478bd9Sstevel@tonic-gate #if defined(_ILP32) && defined(_LP64)
4887c478bd9Sstevel@tonic-gate #error "Both _ILP32 and _LP64 are defined"
4897c478bd9Sstevel@tonic-gate #endif
4907c478bd9Sstevel@tonic-gate 
4917c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
4927c478bd9Sstevel@tonic-gate }
4937c478bd9Sstevel@tonic-gate #endif
4947c478bd9Sstevel@tonic-gate 
4957c478bd9Sstevel@tonic-gate #endif	/* _SYS_ISA_DEFS_H */
496