Home | History | Annotate | Line # | Download | only in sys
      1 /*
      2  * CDDL HEADER START
      3  *
      4  * The contents of this file are subject to the terms of the
      5  * Common Development and Distribution License (the "License").
      6  * You may not use this file except in compliance with the License.
      7  *
      8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9  * or http://www.opensolaris.org/os/licensing.
     10  * See the License for the specific language governing permissions
     11  * and limitations under the License.
     12  *
     13  *
     14  * When distributing Covered Code, include this CDDL HEADER in each
     15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     16  * If applicable, add the following below this CDDL HEADER, with the
     17  * fields enclosed by brackets "[]" replaced with your own identifying
     18  * information: Portions Copyright [yyyy] [name of copyright owner]
     19  *
     20  * CDDL HEADER END
     21  */
     22 
     23 /*
     24  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
     25  * Use is subject to license terms.
     26  */
     27 
     28 #ifndef	_SYS_ISA_DEFS_H
     29 #define	_SYS_ISA_DEFS_H
     30 
     31 /*
     32  * This header file serves to group a set of well known defines and to
     33  * set these for each instruction set architecture.  These defines may
     34  * be divided into two groups;  characteristics of the processor and
     35  * implementation choices for Solaris on a processor.
     36  *
     37  * Processor Characteristics:
     38  *
     39  * _LITTLE_ENDIAN / _BIG_ENDIAN:
     40  *	The natural byte order of the processor.  A pointer to an int points
     41  *	to the least/most significant byte of that int.
     42  *
     43  * _STACK_GROWS_UPWARD / _STACK_GROWS_DOWNWARD:
     44  *	The processor specific direction of stack growth.  A push onto the
     45  *	stack increases/decreases the stack pointer, so it stores data at
     46  *	successively higher/lower addresses.  (Stackless machines ignored
     47  *	without regrets).
     48  *
     49  * _LONG_LONG_HTOL / _LONG_LONG_LTOH:
     50  *	A pointer to a long long points to the most/least significant long
     51  *	within that long long.
     52  *
     53  * _BIT_FIELDS_HTOL / _BIT_FIELDS_LTOH:
     54  *	The C compiler assigns bit fields from the high/low to the low/high end
     55  *	of an int (most to least significant vs. least to most significant).
     56  *
     57  * _IEEE_754:
     58  *	The processor (or supported implementations of the processor)
     59  *	supports the ieee-754 floating point standard.  No other floating
     60  *	point standards are supported (or significant).  Any other supported
     61  *	floating point formats are expected to be cased on the ISA processor
     62  *	symbol.
     63  *
     64  * _CHAR_IS_UNSIGNED / _CHAR_IS_SIGNED:
     65  *	The C Compiler implements objects of type `char' as `unsigned' or
     66  *	`signed' respectively.  This is really an implementation choice of
     67  *	the compiler writer, but it is specified in the ABI and tends to
     68  *	be uniform across compilers for an instruction set architecture.
     69  *	Hence, it has the properties of a processor characteristic.
     70  *
     71  * _CHAR_ALIGNMENT / _SHORT_ALIGNMENT / _INT_ALIGNMENT / _LONG_ALIGNMENT /
     72  * _LONG_LONG_ALIGNMENT / _DOUBLE_ALIGNMENT / _LONG_DOUBLE_ALIGNMENT /
     73  * _POINTER_ALIGNMENT / _FLOAT_ALIGNMENT:
     74  *	The ABI defines alignment requirements of each of the primitive
     75  *	object types.  Some, if not all, may be hardware requirements as
     76  * 	well.  The values are expressed in "byte-alignment" units.
     77  *
     78  * _MAX_ALIGNMENT:
     79  *	The most stringent alignment requirement as specified by the ABI.
     80  *	Equal to the maximum of all the above _XXX_ALIGNMENT values.
     81  *
     82  * _ALIGNMENT_REQUIRED:
     83  *	True or false (1 or 0) whether or not the hardware requires the ABI
     84  *	alignment.
     85  *
     86  * _LONG_LONG_ALIGNMENT_32
     87  *	The 32-bit ABI supported by a 64-bit kernel may have different
     88  *	alignment requirements for primitive object types.  The value of this
     89  *	identifier is expressed in "byte-alignment" units.
     90  *
     91  * _HAVE_CPUID_INSN
     92  *	This indicates that the architecture supports the 'cpuid'
     93  *	instruction as defined by Intel.  (Intel allows other vendors
     94  *	to extend the instruction for their own purposes.)
     95  *
     96  *
     97  * Implementation Choices:
     98  *
     99  * _ILP32 / _LP64:
    100  *	This specifies the compiler data type implementation as specified in
    101  *	the relevant ABI.  The choice between these is strongly influenced
    102  *	by the underlying hardware, but is not absolutely tied to it.
    103  *	Currently only two data type models are supported:
    104  *
    105  *	_ILP32:
    106  *		Int/Long/Pointer are 32 bits.  This is the historical UNIX
    107  *		and Solaris implementation.  Due to its historical standing,
    108  *		this is the default case.
    109  *
    110  *	_LP64:
    111  *		Long/Pointer are 64 bits, Int is 32 bits.  This is the chosen
    112  *		implementation for 64-bit ABIs such as SPARC V9.
    113  *
    114  *	_I32LPx:
    115  *		A compilation environment where 'int' is 32-bit, and
    116  *		longs and pointers are simply the same size.
    117  *
    118  *	In all cases, Char is 8 bits and Short is 16 bits.
    119  *
    120  * _SUNOS_VTOC_8 / _SUNOS_VTOC_16 / _SVR4_VTOC_16:
    121  *	This specifies the form of the disk VTOC (or label):
    122  *
    123  *	_SUNOS_VTOC_8:
    124  *		This is a VTOC form which is upwardly compatible with the
    125  *		SunOS 4.x disk label and allows 8 partitions per disk.
    126  *
    127  *	_SUNOS_VTOC_16:
    128  *		In this format the incore vtoc image matches the ondisk
    129  *		version.  It allows 16 slices per disk, and is not
    130  *		compatible with the SunOS 4.x disk label.
    131  *
    132  *	Note that these are not the only two VTOC forms possible and
    133  *	additional forms may be added.  One possible form would be the
    134  *	SVr4 VTOC form.  The symbol for that is reserved now, although
    135  *	it is not implemented.
    136  *
    137  *	_SVR4_VTOC_16:
    138  *		This VTOC form is compatible with the System V Release 4
    139  *		VTOC (as implemented on the SVr4 Intel and 3b ports) with
    140  *		16 partitions per disk.
    141  *
    142  *
    143  * _DMA_USES_PHYSADDR / _DMA_USES_VIRTADDR
    144  *	This describes the type of addresses used by system DMA:
    145  *
    146  *	_DMA_USES_PHYSADDR:
    147  *		This type of DMA, used in the x86 implementation,
    148  *		requires physical addresses for DMA buffers.  The 24-bit
    149  *		addresses used by some legacy boards is the source of the
    150  *		"low-memory" (<16MB) requirement for some devices using DMA.
    151  *
    152  *	_DMA_USES_VIRTADDR:
    153  *		This method of DMA allows the use of virtual addresses for
    154  *		DMA transfers.
    155  *
    156  * _FIRMWARE_NEEDS_FDISK / _NO_FDISK_PRESENT
    157  *      This indicates the presence/absence of an fdisk table.
    158  *
    159  *      _FIRMWARE_NEEDS_FDISK
    160  *              The fdisk table is required by system firmware.  If present,
    161  *              it allows a disk to be subdivided into multiple fdisk
    162  *              partitions, each of which is equivalent to a separate,
    163  *              virtual disk.  This enables the co-existence of multiple
    164  *              operating systems on a shared hard disk.
    165  *
    166  *      _NO_FDISK_PRESENT
    167  *              If the fdisk table is absent, it is assumed that the entire
    168  *              media is allocated for a single operating system.
    169  *
    170  * _HAVE_TEM_FIRMWARE
    171  *	Defined if this architecture has the (fallback) option of
    172  *	using prom_* calls for doing I/O if a suitable kernel driver
    173  *	is not available to do it.
    174  *
    175  * _DONT_USE_1275_GENERIC_NAMES
    176  *		Controls whether or not device tree node names should
    177  *		comply with the IEEE 1275 "Generic Names" Recommended
    178  *		Practice. With _DONT_USE_GENERIC_NAMES, device-specific
    179  *		names identifying the particular device will be used.
    180  *
    181  * __i386_COMPAT
    182  *	This indicates whether the i386 ABI is supported as a *non-native*
    183  *	mode for the platform.  When this symbol is defined:
    184  *	-	32-bit xstat-style system calls are enabled
    185  *	-	32-bit xmknod-style system calls are enabled
    186  *	-	32-bit system calls use i386 sizes -and- alignments
    187  *
    188  *	Note that this is NOT defined for the i386 native environment!
    189  *
    190  * __x86
    191  *	This is ONLY a synonym for defined(__i386) || defined(__amd64)
    192  *	which is useful only insofar as these two architectures share
    193  *	common attributes.  Analogous to __sparc.
    194  *
    195  * _PSM_MODULES
    196  *	This indicates whether or not the implementation uses PSM
    197  *	modules for processor support, reading /etc/mach from inside
    198  *	the kernel to extract a list.
    199  *
    200  * _RTC_CONFIG
    201  *	This indicates whether or not the implementation uses /etc/rtc_config
    202  *	to configure the real-time clock in the kernel.
    203  *
    204  * _UNIX_KRTLD
    205  *	This indicates that the implementation uses a dynamically
    206  *	linked unix + krtld to form the core kernel image at boot
    207  *	time, or (in the absence of this symbol) a prelinked kernel image.
    208  *
    209  * _OBP
    210  *	This indicates the firmware interface is OBP.
    211  *
    212  * _SOFT_HOSTID
    213  *	This indicates that the implementation obtains the hostid
    214  *	from the file /etc/hostid, rather than from hardware.
    215  */
    216 
    217 #ifdef __NetBSD__
    218 
    219 #include <sys/cdefs.h>
    220 
    221 #ifdef _LP64
    222 __CTASSERT(sizeof(int) == 4);
    223 __CTASSERT(sizeof(long) == 8);
    224 __CTASSERT(sizeof(void *) == 8);
    225 #else
    226 /*
    227  * For 64-bit architectures the compiler defines _LP64.  All else in
    228  * NetBSD is ILP32 for now.
    229  */
    230 __CTASSERT(sizeof(int) == 4);
    231 __CTASSERT(sizeof(long) == 4);
    232 __CTASSERT(sizeof(void *) == 4);
    233 #define	_ILP32	1
    234 #endif
    235 
    236 #else /* __NetBSD__ */
    237 
    238 #ifdef	__cplusplus
    239 extern "C" {
    240 #endif
    241 
    242 /*
    243  * The following set of definitions characterize Solaris on AMD's
    244  * 64-bit systems.
    245  */
    246 #if defined(__x86_64) || defined(__amd64)
    247 
    248 #if !defined(__amd64)
    249 #define	__amd64		/* preferred guard */
    250 #endif
    251 
    252 #if !defined(__x86)
    253 #define	__x86
    254 #endif
    255 
    256 /*
    257  * Define the appropriate "processor characteristics"
    258  */
    259 #ifdef illumos
    260 #define	_LITTLE_ENDIAN
    261 #endif
    262 #define	_STACK_GROWS_DOWNWARD
    263 #define	_LONG_LONG_LTOH
    264 #define	_BIT_FIELDS_LTOH
    265 #define	_IEEE_754
    266 #define	_CHAR_IS_SIGNED
    267 #define	_BOOL_ALIGNMENT			1
    268 #define	_CHAR_ALIGNMENT			1
    269 #define	_SHORT_ALIGNMENT		2
    270 #define	_INT_ALIGNMENT			4
    271 #define	_FLOAT_ALIGNMENT		4
    272 #define	_FLOAT_COMPLEX_ALIGNMENT	4
    273 #define	_LONG_ALIGNMENT			8
    274 #define	_LONG_LONG_ALIGNMENT		8
    275 #define	_DOUBLE_ALIGNMENT		8
    276 #define	_DOUBLE_COMPLEX_ALIGNMENT	8
    277 #define	_LONG_DOUBLE_ALIGNMENT		16
    278 #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	16
    279 #define	_POINTER_ALIGNMENT		8
    280 #define	_MAX_ALIGNMENT			16
    281 #define	_ALIGNMENT_REQUIRED		1
    282 
    283 /*
    284  * Different alignment constraints for the i386 ABI in compatibility mode
    285  */
    286 #define	_LONG_LONG_ALIGNMENT_32		4
    287 
    288 /*
    289  * Define the appropriate "implementation choices".
    290  */
    291 #if !defined(_LP64)
    292 #define	_LP64
    293 #endif
    294 #if !defined(_I32LPx) && defined(_KERNEL)
    295 #define	_I32LPx
    296 #endif
    297 #define	_MULTI_DATAMODEL
    298 #define	_SUNOS_VTOC_16
    299 #define	_DMA_USES_PHYSADDR
    300 #define	_FIRMWARE_NEEDS_FDISK
    301 #define	__i386_COMPAT
    302 #define	_PSM_MODULES
    303 #define	_RTC_CONFIG
    304 #define	_SOFT_HOSTID
    305 #define	_DONT_USE_1275_GENERIC_NAMES
    306 #define	_HAVE_CPUID_INSN
    307 
    308 /*
    309  * The feature test macro __i386 is generic for all processors implementing
    310  * the Intel 386 instruction set or a superset of it.  Specifically, this
    311  * includes all members of the 386, 486, and Pentium family of processors.
    312  */
    313 #elif defined(__i386) || defined(__i386__)
    314 
    315 #if !defined(__i386)
    316 #define	__i386
    317 #endif
    318 
    319 #if !defined(__x86)
    320 #define	__x86
    321 #endif
    322 
    323 /*
    324  * Define the appropriate "processor characteristics"
    325  */
    326 #ifdef illumos
    327 #define	_LITTLE_ENDIAN
    328 #endif
    329 #define	_STACK_GROWS_DOWNWARD
    330 #define	_LONG_LONG_LTOH
    331 #define	_BIT_FIELDS_LTOH
    332 #define	_IEEE_754
    333 #define	_CHAR_IS_SIGNED
    334 #define	_BOOL_ALIGNMENT			1
    335 #define	_CHAR_ALIGNMENT			1
    336 #define	_SHORT_ALIGNMENT		2
    337 #define	_INT_ALIGNMENT			4
    338 #define	_FLOAT_ALIGNMENT		4
    339 #define	_FLOAT_COMPLEX_ALIGNMENT	4
    340 #define	_LONG_ALIGNMENT			4
    341 #define	_LONG_LONG_ALIGNMENT		4
    342 #define	_DOUBLE_ALIGNMENT		4
    343 #define	_DOUBLE_COMPLEX_ALIGNMENT	4
    344 #define	_LONG_DOUBLE_ALIGNMENT		4
    345 #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	4
    346 #define	_POINTER_ALIGNMENT		4
    347 #define	_MAX_ALIGNMENT			4
    348 #define	_ALIGNMENT_REQUIRED		0
    349 
    350 #define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGNMENT
    351 
    352 /*
    353  * Define the appropriate "implementation choices".
    354  */
    355 #if !defined(_ILP32)
    356 #define	_ILP32
    357 #endif
    358 #if !defined(_I32LPx) && defined(_KERNEL)
    359 #define	_I32LPx
    360 #endif
    361 #define	_SUNOS_VTOC_16
    362 #define	_DMA_USES_PHYSADDR
    363 #define	_FIRMWARE_NEEDS_FDISK
    364 #define	_PSM_MODULES
    365 #define	_RTC_CONFIG
    366 #define	_SOFT_HOSTID
    367 #define	_DONT_USE_1275_GENERIC_NAMES
    368 #define	_HAVE_CPUID_INSN
    369 
    370 #elif defined(__aarch64__)
    371 
    372 /*
    373  * Define the appropriate "processor characteristics"
    374  */
    375 #define	_STACK_GROWS_DOWNWARD
    376 #define	_LONG_LONG_LTOH
    377 #define	_BIT_FIELDS_LTOH
    378 #define	_IEEE_754
    379 #define	_CHAR_IS_UNSIGNED
    380 #define	_BOOL_ALIGNMENT			1
    381 #define	_CHAR_ALIGNMENT			1
    382 #define	_SHORT_ALIGNMENT		2
    383 #define	_INT_ALIGNMENT			4
    384 #define	_FLOAT_ALIGNMENT		4
    385 #define	_FLOAT_COMPLEX_ALIGNMENT	4
    386 #define	_LONG_ALIGNMENT			8
    387 #define	_LONG_LONG_ALIGNMENT		8
    388 #define	_DOUBLE_ALIGNMENT		8
    389 #define	_DOUBLE_COMPLEX_ALIGNMENT	8
    390 #define	_LONG_DOUBLE_ALIGNMENT		16
    391 #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	16
    392 #define	_POINTER_ALIGNMENT		8
    393 #define	_MAX_ALIGNMENT			16
    394 #define	_ALIGNMENT_REQUIRED		1
    395 
    396 #define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGNMENT
    397 
    398 /*
    399  * Define the appropriate "implementation choices"
    400  */
    401 #if !defined(_LP64)
    402 #define	_LP64
    403 #endif
    404 #define	_SUNOS_VTOC_16
    405 #define	_DMA_USES_PHYSADDR
    406 #define	_FIRMWARE_NEEDS_FDISK
    407 #define	_PSM_MODULES
    408 #define	_RTC_CONFIG
    409 #define	_DONT_USE_1275_GENERIC_NAMES
    410 #define	_HAVE_CPUID_INSN
    411 
    412 #elif defined(__riscv__)
    413 
    414 /*
    415  * Define the appropriate "processor characteristics"
    416  */
    417 #define	_STACK_GROWS_DOWNWARD
    418 #define	_LONG_LONG_LTOH
    419 #define	_BIT_FIELDS_LTOH
    420 #define	_IEEE_754
    421 #define	_CHAR_IS_UNSIGNED
    422 #define	_BOOL_ALIGNMENT			1
    423 #define	_CHAR_ALIGNMENT			1
    424 #define	_SHORT_ALIGNMENT		2
    425 #define	_INT_ALIGNMENT			4
    426 #define	_FLOAT_ALIGNMENT		4
    427 #define	_FLOAT_COMPLEX_ALIGNMENT	4
    428 #define	_LONG_ALIGNMENT			8
    429 #define	_LONG_LONG_ALIGNMENT		8
    430 #define	_DOUBLE_ALIGNMENT		8
    431 #define	_DOUBLE_COMPLEX_ALIGNMENT	8
    432 #define	_LONG_DOUBLE_ALIGNMENT		16
    433 #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	16
    434 #define	_POINTER_ALIGNMENT		8
    435 #define	_MAX_ALIGNMENT			16
    436 #define	_ALIGNMENT_REQUIRED		1
    437 
    438 #define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGNMENT
    439 
    440 /*
    441  * Define the appropriate "implementation choices"
    442  */
    443 #if !defined(_LP64)
    444 #define	_LP64
    445 #endif
    446 #define	_SUNOS_VTOC_16
    447 #define	_DMA_USES_PHYSADDR
    448 #define	_FIRMWARE_NEEDS_FDISK
    449 #define	_PSM_MODULES
    450 #define	_RTC_CONFIG
    451 #define	_DONT_USE_1275_GENERIC_NAMES
    452 #define	_HAVE_CPUID_INSN
    453 
    454 #elif defined(__arm__)
    455 
    456 /*
    457  * Define the appropriate "processor characteristics"
    458  */
    459 #define	_STACK_GROWS_DOWNWARD
    460 #define	_LONG_LONG_LTOH
    461 #define	_BIT_FIELDS_LTOH
    462 #define	_IEEE_754
    463 #define	_CHAR_IS_SIGNED
    464 #define	_BOOL_ALIGNMENT			1
    465 #define	_CHAR_ALIGNMENT			1
    466 #define	_SHORT_ALIGNMENT		2
    467 #define	_INT_ALIGNMENT			4
    468 #define	_FLOAT_ALIGNMENT		4
    469 #define	_FLOAT_COMPLEX_ALIGNMENT	4
    470 #define	_LONG_ALIGNMENT			4
    471 #define	_LONG_LONG_ALIGNMENT		4
    472 #define	_DOUBLE_ALIGNMENT		4
    473 #define	_DOUBLE_COMPLEX_ALIGNMENT	4
    474 #define	_LONG_DOUBLE_ALIGNMENT		4
    475 #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	4
    476 #define	_POINTER_ALIGNMENT		4
    477 #define	_MAX_ALIGNMENT			4
    478 #define	_ALIGNMENT_REQUIRED		0
    479 
    480 #define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGNMENT
    481 
    482 /*
    483  * Define the appropriate "implementation choices".
    484  */
    485 #if !defined(_ILP32)
    486 #define	_ILP32
    487 #endif
    488 #if !defined(_I32LPx) && defined(_KERNEL)
    489 #define	_I32LPx
    490 #endif
    491 #define	_SUNOS_VTOC_16
    492 #define	_DMA_USES_PHYSADDR
    493 #define	_FIRMWARE_NEEDS_FDISK
    494 #define	_PSM_MODULES
    495 #define	_RTC_CONFIG
    496 #define	_DONT_USE_1275_GENERIC_NAMES
    497 #define	_HAVE_CPUID_INSN
    498 
    499 #elif defined(__mips__)
    500 
    501 /*
    502  * Define the appropriate "processor characteristics"
    503  */
    504 #define	_STACK_GROWS_DOWNWARD
    505 #define	_LONG_LONG_LTOH
    506 #define	_BIT_FIELDS_LTOH
    507 #define	_IEEE_754
    508 #define	_CHAR_IS_SIGNED
    509 #define	_BOOL_ALIGNMENT			1
    510 #define	_CHAR_ALIGNMENT			1
    511 #define	_SHORT_ALIGNMENT		2
    512 #define	_INT_ALIGNMENT			4
    513 #define	_FLOAT_ALIGNMENT		4
    514 #define	_FLOAT_COMPLEX_ALIGNMENT	4
    515 #if defined(__mips_n64)
    516 #define	_LONG_ALIGNMENT			8
    517 #define	_LONG_LONG_ALIGNMENT		8
    518 #define	_DOUBLE_ALIGNMENT		8
    519 #define	_DOUBLE_COMPLEX_ALIGNMENT	8
    520 #define	_LONG_DOUBLE_ALIGNMENT		8
    521 #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	8
    522 #define	_POINTER_ALIGNMENT		8
    523 #define	_MAX_ALIGNMENT			8
    524 #define	_ALIGNMENT_REQUIRED		0
    525 
    526 #define	_LONG_LONG_ALIGNMENT_32		_INT_ALIGNMENT
    527 /*
    528  * Define the appropriate "implementation choices".
    529  */
    530 #if !defined(_LP64)
    531 #define	_LP64
    532 #endif
    533 #else
    534 #define	_LONG_ALIGNMENT			4
    535 #define	_LONG_LONG_ALIGNMENT		4
    536 #define	_DOUBLE_ALIGNMENT		4
    537 #define	_DOUBLE_COMPLEX_ALIGNMENT	4
    538 #define	_LONG_DOUBLE_ALIGNMENT		4
    539 #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	4
    540 #define	_POINTER_ALIGNMENT		4
    541 #define	_MAX_ALIGNMENT			4
    542 #define	_ALIGNMENT_REQUIRED		0
    543 
    544 #define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGNMENT
    545 
    546 /*
    547  * Define the appropriate "implementation choices".
    548  */
    549 #define	_ILP32
    550 #if !defined(_I32LPx) && defined(_KERNEL)
    551 #define	_I32LPx
    552 #endif
    553 #endif
    554 #define	_SUNOS_VTOC_16
    555 #define	_DMA_USES_PHYSADDR
    556 #define	_FIRMWARE_NEEDS_FDISK
    557 #define	_PSM_MODULES
    558 #define	_RTC_CONFIG
    559 #define	_DONT_USE_1275_GENERIC_NAMES
    560 #define	_HAVE_CPUID_INSN
    561 
    562 #elif defined(__powerpc__)
    563 
    564 #if defined(__BIG_ENDIAN__)
    565 #define _BIT_FIELDS_HTOL
    566 #else
    567 #define _BIT_FIELDS_LTOH
    568 #endif
    569 
    570 /*
    571  * The following set of definitions characterize the Solaris on SPARC systems.
    572  *
    573  * The symbol __sparc indicates any of the SPARC family of processor
    574  * architectures.  This includes SPARC V7, SPARC V8 and SPARC V9.
    575  *
    576  * The symbol __sparcv8 indicates the 32-bit SPARC V8 architecture as defined
    577  * by Version 8 of the SPARC Architecture Manual.  (SPARC V7 is close enough
    578  * to SPARC V8 for the former to be subsumed into the latter definition.)
    579  *
    580  * The symbol __sparcv9 indicates the 64-bit SPARC V9 architecture as defined
    581  * by Version 9 of the SPARC Architecture Manual.
    582  *
    583  * The symbols __sparcv8 and __sparcv9 are mutually exclusive, and are only
    584  * relevant when the symbol __sparc is defined.
    585  */
    586 /*
    587  * XXX Due to the existence of 5110166, "defined(__sparcv9)" needs to be added
    588  * to support backwards builds.  This workaround should be removed in s10_71.
    589  */
    590 #elif defined(__sparc) || defined(__sparcv9) || defined(__sparc__)
    591 #if !defined(__sparc)
    592 #define	__sparc
    593 #endif
    594 
    595 /*
    596  * You can be 32-bit or 64-bit, but not both at the same time.
    597  */
    598 #if defined(__sparcv8) && defined(__sparcv9)
    599 #error	"SPARC Versions 8 and 9 are mutually exclusive choices"
    600 #endif
    601 
    602 /*
    603  * Existing compilers do not set __sparcv8.  Years will transpire before
    604  * the compilers can be depended on to set the feature test macro. In
    605  * the interim, we'll set it here on the basis of historical behaviour;
    606  * if you haven't asked for SPARC V9, then you must've meant SPARC V8.
    607  */
    608 #if !defined(__sparcv9) && !defined(__sparcv8)
    609 #define	__sparcv8
    610 #endif
    611 
    612 /*
    613  * Define the appropriate "processor characteristics" shared between
    614  * all Solaris on SPARC systems.
    615  */
    616 #ifdef illumos
    617 #define	_BIG_ENDIAN
    618 #endif
    619 #define	_STACK_GROWS_DOWNWARD
    620 #define	_LONG_LONG_HTOL
    621 #define	_BIT_FIELDS_HTOL
    622 #define	_IEEE_754
    623 #define	_CHAR_IS_SIGNED
    624 #define	_BOOL_ALIGNMENT			1
    625 #define	_CHAR_ALIGNMENT			1
    626 #define	_SHORT_ALIGNMENT		2
    627 #define	_INT_ALIGNMENT			4
    628 #define	_FLOAT_ALIGNMENT		4
    629 #define	_FLOAT_COMPLEX_ALIGNMENT	4
    630 #define	_LONG_LONG_ALIGNMENT		8
    631 #define	_DOUBLE_ALIGNMENT		8
    632 #define	_DOUBLE_COMPLEX_ALIGNMENT	8
    633 #define	_ALIGNMENT_REQUIRED		1
    634 
    635 /*
    636  * Define the appropriate "implementation choices" shared between versions.
    637  */
    638 #define	_SUNOS_VTOC_8
    639 #define	_DMA_USES_VIRTADDR
    640 #define	_NO_FDISK_PRESENT
    641 #define	_HAVE_TEM_FIRMWARE
    642 #define	_OBP
    643 
    644 /*
    645  * The following set of definitions characterize the implementation of
    646  * 32-bit Solaris on SPARC V8 systems.
    647  */
    648 #if defined(__sparcv8)
    649 
    650 /*
    651  * Define the appropriate "processor characteristics"
    652  */
    653 #define	_LONG_ALIGNMENT			4
    654 #define	_LONG_DOUBLE_ALIGNMENT		8
    655 #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	8
    656 #define	_POINTER_ALIGNMENT		4
    657 #define	_MAX_ALIGNMENT			8
    658 
    659 #define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGNMENT
    660 
    661 /*
    662  * Define the appropriate "implementation choices"
    663  */
    664 #define	_ILP32
    665 #if !defined(_I32LPx) && defined(_KERNEL)
    666 #define	_I32LPx
    667 #endif
    668 
    669 /*
    670  * The following set of definitions characterize the implementation of
    671  * 64-bit Solaris on SPARC V9 systems.
    672  */
    673 #elif defined(__sparcv9)
    674 
    675 /*
    676  * Define the appropriate "processor characteristics"
    677  */
    678 #define	_LONG_ALIGNMENT			8
    679 #define	_LONG_DOUBLE_ALIGNMENT		16
    680 #define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	16
    681 #define	_POINTER_ALIGNMENT		8
    682 #define	_MAX_ALIGNMENT			16
    683 
    684 #define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGNMENT
    685 
    686 /*
    687  * Define the appropriate "implementation choices"
    688  */
    689 #if !defined(_LP64)
    690 #define	_LP64
    691 #endif
    692 #if !defined(_I32LPx)
    693 #define	_I32LPx
    694 #endif
    695 #define	_MULTI_DATAMODEL
    696 
    697 #else
    698 #error	"unknown SPARC version"
    699 #endif
    700 
    701 /*
    702  * #error is strictly ansi-C, but works as well as anything for K&R systems.
    703  */
    704 #else
    705 #error "ISA not supported"
    706 #endif
    707 
    708 #if defined(_ILP32) && defined(_LP64)
    709 #error "Both _ILP32 and _LP64 are defined"
    710 #endif
    711 
    712 #ifdef	__cplusplus
    713 }
    714 #endif
    715 
    716 #endif /* __NetBSD__ */
    717 
    718 #endif	/* _SYS_ISA_DEFS_H */
    719