freebsd: simplify MD isa_defs.h

Most of this file was a pile of defines, apparently from Solaris that
controlled nothing in the source tree.  A few things controlled the
definition of unused types or macros which I have removed.

Considerable further cleanup is possible including removal of
architectures FreeBSD never supported.  This file should likely converge
with the Linux version to the extent possible.

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Brooks Davis <brooks.davis@sri.com>
Closes #14127
This commit is contained in:
Brooks Davis 2022-10-28 00:55:45 +01:00 committed by Brian Behlendorf
parent e3ba8eb12e
commit ecbf02791f
3 changed files with 0 additions and 480 deletions

View File

@ -41,59 +41,6 @@
* The natural byte order of the processor. A pointer to an int points
* to the least/most significant byte of that int.
*
* _STACK_GROWS_UPWARD / _STACK_GROWS_DOWNWARD:
* The processor specific direction of stack growth. A push onto the
* stack increases/decreases the stack pointer, so it stores data at
* successively higher/lower addresses. (Stackless machines ignored
* without regrets).
*
* _LONG_LONG_HTOL / _LONG_LONG_LTOH:
* A pointer to a long long points to the most/least significant long
* within that long long.
*
* _BIT_FIELDS_HTOL / _BIT_FIELDS_LTOH:
* The C compiler assigns bit fields from the high/low to the low/high end
* of an int (most to least significant vs. least to most significant).
*
* _IEEE_754:
* The processor (or supported implementations of the processor)
* supports the ieee-754 floating point standard. No other floating
* point standards are supported (or significant). Any other supported
* floating point formats are expected to be cased on the ISA processor
* symbol.
*
* _CHAR_IS_UNSIGNED / _CHAR_IS_SIGNED:
* The C Compiler implements objects of type `char' as `unsigned' or
* `signed' respectively. This is really an implementation choice of
* the compiler writer, but it is specified in the ABI and tends to
* be uniform across compilers for an instruction set architecture.
* Hence, it has the properties of a processor characteristic.
*
* _CHAR_ALIGNMENT / _SHORT_ALIGNMENT / _INT_ALIGNMENT / _LONG_ALIGNMENT /
* _LONG_LONG_ALIGNMENT / _DOUBLE_ALIGNMENT / _LONG_DOUBLE_ALIGNMENT /
* _POINTER_ALIGNMENT / _FLOAT_ALIGNMENT:
* The ABI defines alignment requirements of each of the primitive
* object types. Some, if not all, may be hardware requirements as
* well. The values are expressed in "byte-alignment" units.
*
* _MAX_ALIGNMENT:
* The most stringent alignment requirement as specified by the ABI.
* Equal to the maximum of all the above _XXX_ALIGNMENT values.
*
* _ALIGNMENT_REQUIRED:
* True or false (1 or 0) whether or not the hardware requires the ABI
* alignment.
*
* _LONG_LONG_ALIGNMENT_32
* The 32-bit ABI supported by a 64-bit kernel may have different
* alignment requirements for primitive object types. The value of this
* identifier is expressed in "byte-alignment" units.
*
* _HAVE_CPUID_INSN
* This indicates that the architecture supports the 'cpuid'
* instruction as defined by Intel. (Intel allows other vendors
* to extend the instruction for their own purposes.)
*
*
* Implementation Choices:
*
@ -112,10 +59,6 @@
* Long/Pointer are 64 bits, Int is 32 bits. This is the chosen
* implementation for 64-bit ABIs such as SPARC V9.
*
* _I32LPx:
* A compilation environment where 'int' is 32-bit, and
* longs and pointers are simply the same size.
*
* In all cases, Char is 8 bits and Short is 16 bits.
*
* _SUNOS_VTOC_8 / _SUNOS_VTOC_16 / _SVR4_VTOC_16:
@ -141,78 +84,10 @@
* 16 partitions per disk.
*
*
* _DMA_USES_PHYSADDR / _DMA_USES_VIRTADDR
* This describes the type of addresses used by system DMA:
*
* _DMA_USES_PHYSADDR:
* This type of DMA, used in the x86 implementation,
* requires physical addresses for DMA buffers. The 24-bit
* addresses used by some legacy boards is the source of the
* "low-memory" (<16MB) requirement for some devices using DMA.
*
* _DMA_USES_VIRTADDR:
* This method of DMA allows the use of virtual addresses for
* DMA transfers.
*
* _FIRMWARE_NEEDS_FDISK / _NO_FDISK_PRESENT
* This indicates the presence/absence of an fdisk table.
*
* _FIRMWARE_NEEDS_FDISK
* The fdisk table is required by system firmware. If present,
* it allows a disk to be subdivided into multiple fdisk
* partitions, each of which is equivalent to a separate,
* virtual disk. This enables the co-existence of multiple
* operating systems on a shared hard disk.
*
* _NO_FDISK_PRESENT
* If the fdisk table is absent, it is assumed that the entire
* media is allocated for a single operating system.
*
* _HAVE_TEM_FIRMWARE
* Defined if this architecture has the (fallback) option of
* using prom_* calls for doing I/O if a suitable kernel driver
* is not available to do it.
*
* _DONT_USE_1275_GENERIC_NAMES
* Controls whether or not device tree node names should
* comply with the IEEE 1275 "Generic Names" Recommended
* Practice. With _DONT_USE_GENERIC_NAMES, device-specific
* names identifying the particular device will be used.
*
* __i386_COMPAT
* This indicates whether the i386 ABI is supported as a *non-native*
* mode for the platform. When this symbol is defined:
* - 32-bit xstat-style system calls are enabled
* - 32-bit xmknod-style system calls are enabled
* - 32-bit system calls use i386 sizes -and- alignments
*
* Note that this is NOT defined for the i386 native environment!
*
* __x86
* This is ONLY a synonym for defined(__i386) || defined(__amd64)
* which is useful only insofar as these two architectures share
* common attributes. Analogous to __sparc.
*
* _PSM_MODULES
* This indicates whether or not the implementation uses PSM
* modules for processor support, reading /etc/mach from inside
* the kernel to extract a list.
*
* _RTC_CONFIG
* This indicates whether or not the implementation uses /etc/rtc_config
* to configure the real-time clock in the kernel.
*
* _UNIX_KRTLD
* This indicates that the implementation uses a dynamically
* linked unix + krtld to form the core kernel image at boot
* time, or (in the absence of this symbol) a prelinked kernel image.
*
* _OBP
* This indicates the firmware interface is OBP.
*
* _SOFT_HOSTID
* This indicates that the implementation obtains the hostid
* from the file /etc/hostid, rather than from hardware.
*/
#ifdef __cplusplus
@ -233,54 +108,13 @@ extern "C" {
#define __x86
#endif
/*
* Define the appropriate "processor characteristics"
*/
#define _STACK_GROWS_DOWNWARD
#define _LONG_LONG_LTOH
#define _BIT_FIELDS_LTOH
#define _IEEE_754
#define _CHAR_IS_SIGNED
#define _BOOL_ALIGNMENT 1
#define _CHAR_ALIGNMENT 1
#define _SHORT_ALIGNMENT 2
#define _INT_ALIGNMENT 4
#define _FLOAT_ALIGNMENT 4
#define _FLOAT_COMPLEX_ALIGNMENT 4
#define _LONG_ALIGNMENT 8
#define _LONG_LONG_ALIGNMENT 8
#define _DOUBLE_ALIGNMENT 8
#define _DOUBLE_COMPLEX_ALIGNMENT 8
#define _LONG_DOUBLE_ALIGNMENT 16
#define _LONG_DOUBLE_COMPLEX_ALIGNMENT 16
#define _POINTER_ALIGNMENT 8
#define _MAX_ALIGNMENT 16
#define _ALIGNMENT_REQUIRED 1
/*
* Different alignment constraints for the i386 ABI in compatibility mode
*/
#define _LONG_LONG_ALIGNMENT_32 4
/*
* Define the appropriate "implementation choices".
*/
#if !defined(_LP64)
#error "_LP64 not defined"
#endif
#if !defined(_I32LPx)
#define _I32LPx
#endif
#define _MULTI_DATAMODEL
#define _SUNOS_VTOC_16
#define _DMA_USES_PHYSADDR
#define _FIRMWARE_NEEDS_FDISK
#define __i386_COMPAT
#define _PSM_MODULES
#define _RTC_CONFIG
#define _SOFT_HOSTID
#define _DONT_USE_1275_GENERIC_NAMES
#define _HAVE_CPUID_INSN
/*
* The feature test macro __i386 is generic for all processors implementing
@ -297,78 +131,16 @@ extern "C" {
#define __x86
#endif
/*
* Define the appropriate "processor characteristics"
*/
#define _STACK_GROWS_DOWNWARD
#define _LONG_LONG_LTOH
#define _BIT_FIELDS_LTOH
#define _IEEE_754
#define _CHAR_IS_SIGNED
#define _BOOL_ALIGNMENT 1
#define _CHAR_ALIGNMENT 1
#define _SHORT_ALIGNMENT 2
#define _INT_ALIGNMENT 4
#define _FLOAT_ALIGNMENT 4
#define _FLOAT_COMPLEX_ALIGNMENT 4
#define _LONG_ALIGNMENT 4
#define _LONG_LONG_ALIGNMENT 4
#define _DOUBLE_ALIGNMENT 4
#define _DOUBLE_COMPLEX_ALIGNMENT 4
#define _LONG_DOUBLE_ALIGNMENT 4
#define _LONG_DOUBLE_COMPLEX_ALIGNMENT 4
#define _POINTER_ALIGNMENT 4
#define _MAX_ALIGNMENT 4
#define _ALIGNMENT_REQUIRED 0
#define _LONG_LONG_ALIGNMENT_32 _LONG_LONG_ALIGNMENT
/*
* Define the appropriate "implementation choices".
*/
#if !defined(_ILP32)
#define _ILP32
#endif
#if !defined(_I32LPx)
#define _I32LPx
#endif
#define _SUNOS_VTOC_16
#define _DMA_USES_PHYSADDR
#define _FIRMWARE_NEEDS_FDISK
#define _PSM_MODULES
#define _RTC_CONFIG
#define _SOFT_HOSTID
#define _DONT_USE_1275_GENERIC_NAMES
#define _HAVE_CPUID_INSN
#elif defined(__aarch64__)
/*
* Define the appropriate "processor characteristics"
*/
#define _STACK_GROWS_DOWNWARD
#define _LONG_LONG_LTOH
#define _BIT_FIELDS_LTOH
#define _IEEE_754
#define _CHAR_IS_UNSIGNED
#define _BOOL_ALIGNMENT 1
#define _CHAR_ALIGNMENT 1
#define _SHORT_ALIGNMENT 2
#define _INT_ALIGNMENT 4
#define _FLOAT_ALIGNMENT 4
#define _FLOAT_COMPLEX_ALIGNMENT 4
#define _LONG_ALIGNMENT 8
#define _LONG_LONG_ALIGNMENT 8
#define _DOUBLE_ALIGNMENT 8
#define _DOUBLE_COMPLEX_ALIGNMENT 8
#define _LONG_DOUBLE_ALIGNMENT 16
#define _LONG_DOUBLE_COMPLEX_ALIGNMENT 16
#define _POINTER_ALIGNMENT 8
#define _MAX_ALIGNMENT 16
#define _ALIGNMENT_REQUIRED 1
#define _LONG_LONG_ALIGNMENT_32 _LONG_LONG_ALIGNMENT
/*
* Define the appropriate "implementation choices"
*/
@ -376,41 +148,9 @@ extern "C" {
#error "_LP64 not defined"
#endif
#define _SUNOS_VTOC_16
#define _DMA_USES_PHYSADDR
#define _FIRMWARE_NEEDS_FDISK
#define _PSM_MODULES
#define _RTC_CONFIG
#define _DONT_USE_1275_GENERIC_NAMES
#define _HAVE_CPUID_INSN
#elif defined(__riscv)
/*
* Define the appropriate "processor characteristics"
*/
#define _STACK_GROWS_DOWNWARD
#define _LONG_LONG_LTOH
#define _BIT_FIELDS_LTOH
#define _IEEE_754
#define _CHAR_IS_UNSIGNED
#define _BOOL_ALIGNMENT 1
#define _CHAR_ALIGNMENT 1
#define _SHORT_ALIGNMENT 2
#define _INT_ALIGNMENT 4
#define _FLOAT_ALIGNMENT 4
#define _FLOAT_COMPLEX_ALIGNMENT 4
#define _LONG_ALIGNMENT 8
#define _LONG_LONG_ALIGNMENT 8
#define _DOUBLE_ALIGNMENT 8
#define _DOUBLE_COMPLEX_ALIGNMENT 8
#define _LONG_DOUBLE_ALIGNMENT 16
#define _LONG_DOUBLE_COMPLEX_ALIGNMENT 16
#define _POINTER_ALIGNMENT 8
#define _MAX_ALIGNMENT 16
#define _ALIGNMENT_REQUIRED 1
#define _LONG_LONG_ALIGNMENT_32 _LONG_LONG_ALIGNMENT
/*
* Define the appropriate "implementation choices"
*/
@ -418,86 +158,20 @@ extern "C" {
#define _LP64
#endif
#define _SUNOS_VTOC_16
#define _DMA_USES_PHYSADDR
#define _FIRMWARE_NEEDS_FDISK
#define _PSM_MODULES
#define _RTC_CONFIG
#define _DONT_USE_1275_GENERIC_NAMES
#define _HAVE_CPUID_INSN
#elif defined(__arm__)
/*
* Define the appropriate "processor characteristics"
*/
#define _STACK_GROWS_DOWNWARD
#define _LONG_LONG_LTOH
#define _BIT_FIELDS_LTOH
#define _IEEE_754
#define _CHAR_IS_SIGNED
#define _BOOL_ALIGNMENT 1
#define _CHAR_ALIGNMENT 1
#define _SHORT_ALIGNMENT 2
#define _INT_ALIGNMENT 4
#define _FLOAT_ALIGNMENT 4
#define _FLOAT_COMPLEX_ALIGNMENT 4
#define _LONG_ALIGNMENT 4
#define _LONG_LONG_ALIGNMENT 4
#define _DOUBLE_ALIGNMENT 4
#define _DOUBLE_COMPLEX_ALIGNMENT 4
#define _LONG_DOUBLE_ALIGNMENT 4
#define _LONG_DOUBLE_COMPLEX_ALIGNMENT 4
#define _POINTER_ALIGNMENT 4
#define _MAX_ALIGNMENT 4
#define _ALIGNMENT_REQUIRED 0
#define _LONG_LONG_ALIGNMENT_32 _LONG_LONG_ALIGNMENT
/*
* Define the appropriate "implementation choices".
*/
#if !defined(_ILP32)
#define _ILP32
#endif
#if !defined(_I32LPx)
#define _I32LPx
#endif
#define _SUNOS_VTOC_16
#define _DMA_USES_PHYSADDR
#define _FIRMWARE_NEEDS_FDISK
#define _PSM_MODULES
#define _RTC_CONFIG
#define _DONT_USE_1275_GENERIC_NAMES
#define _HAVE_CPUID_INSN
#elif defined(__mips__)
/*
* Define the appropriate "processor characteristics"
*/
#define _STACK_GROWS_DOWNWARD
#define _LONG_LONG_LTOH
#define _BIT_FIELDS_LTOH
#define _IEEE_754
#define _CHAR_IS_SIGNED
#define _BOOL_ALIGNMENT 1
#define _CHAR_ALIGNMENT 1
#define _SHORT_ALIGNMENT 2
#define _INT_ALIGNMENT 4
#define _FLOAT_ALIGNMENT 4
#define _FLOAT_COMPLEX_ALIGNMENT 4
#if defined(__mips_n64)
#define _LONG_ALIGNMENT 8
#define _LONG_LONG_ALIGNMENT 8
#define _DOUBLE_ALIGNMENT 8
#define _DOUBLE_COMPLEX_ALIGNMENT 8
#define _LONG_DOUBLE_ALIGNMENT 8
#define _LONG_DOUBLE_COMPLEX_ALIGNMENT 8
#define _POINTER_ALIGNMENT 8
#define _MAX_ALIGNMENT 8
#define _ALIGNMENT_REQUIRED 0
#define _LONG_LONG_ALIGNMENT_32 _INT_ALIGNMENT
/*
* Define the appropriate "implementation choices".
*/
@ -505,57 +179,21 @@ extern "C" {
#error "_LP64 not defined"
#endif
#else
#define _LONG_ALIGNMENT 4
#define _LONG_LONG_ALIGNMENT 4
#define _DOUBLE_ALIGNMENT 4
#define _DOUBLE_COMPLEX_ALIGNMENT 4
#define _LONG_DOUBLE_ALIGNMENT 4
#define _LONG_DOUBLE_COMPLEX_ALIGNMENT 4
#define _POINTER_ALIGNMENT 4
#define _MAX_ALIGNMENT 4
#define _ALIGNMENT_REQUIRED 0
#define _LONG_LONG_ALIGNMENT_32 _LONG_LONG_ALIGNMENT
/*
* Define the appropriate "implementation choices".
*/
#if !defined(_ILP32)
#define _ILP32
#endif
#if !defined(_I32LPx)
#define _I32LPx
#endif
#endif
#define _SUNOS_VTOC_16
#define _DMA_USES_PHYSADDR
#define _FIRMWARE_NEEDS_FDISK
#define _PSM_MODULES
#define _RTC_CONFIG
#define _DONT_USE_1275_GENERIC_NAMES
#define _HAVE_CPUID_INSN
#elif defined(__powerpc__)
#if defined(__BIG_ENDIAN__)
#define _BIT_FIELDS_HTOL
#else
#define _BIT_FIELDS_LTOH
#endif
#if !defined(__powerpc)
#define __powerpc
#endif
#if defined(__powerpc64__)
#define _LONG_LONG_ALIGNMENT 8
#define _MULTI_DATAMODEL
#else
#define _LONG_LONG_ALIGNMENT 4
#endif
#define _LONG_LONG_ALIGNMENT_32 4
#define _ALIGNMENT_REQUIRED 1
#define _SUNOS_VTOC_16 1
/*
@ -600,34 +238,10 @@ extern "C" {
#define __sparcv8
#endif
/*
* Define the appropriate "processor characteristics" shared between
* all Solaris on SPARC systems.
*/
#define _STACK_GROWS_DOWNWARD
#define _LONG_LONG_HTOL
#define _BIT_FIELDS_HTOL
#define _IEEE_754
#define _CHAR_IS_SIGNED
#define _BOOL_ALIGNMENT 1
#define _CHAR_ALIGNMENT 1
#define _SHORT_ALIGNMENT 2
#define _INT_ALIGNMENT 4
#define _FLOAT_ALIGNMENT 4
#define _FLOAT_COMPLEX_ALIGNMENT 4
#define _LONG_LONG_ALIGNMENT 8
#define _DOUBLE_ALIGNMENT 8
#define _DOUBLE_COMPLEX_ALIGNMENT 8
#define _ALIGNMENT_REQUIRED 1
/*
* Define the appropriate "implementation choices" shared between versions.
*/
#define _SUNOS_VTOC_8
#define _DMA_USES_VIRTADDR
#define _NO_FDISK_PRESENT
#define _HAVE_TEM_FIRMWARE
#define _OBP
/*
* The following set of definitions characterize the implementation of
@ -635,24 +249,10 @@ extern "C" {
*/
#if defined(__sparcv8)
/*
* Define the appropriate "processor characteristics"
*/
#define _LONG_ALIGNMENT 4
#define _LONG_DOUBLE_ALIGNMENT 8
#define _LONG_DOUBLE_COMPLEX_ALIGNMENT 8
#define _POINTER_ALIGNMENT 4
#define _MAX_ALIGNMENT 8
#define _LONG_LONG_ALIGNMENT_32 _LONG_LONG_ALIGNMENT
/*
* Define the appropriate "implementation choices"
*/
#define _ILP32
#if !defined(_I32LPx)
#define _I32LPx
#endif
/*
* The following set of definitions characterize the implementation of
@ -660,27 +260,12 @@ extern "C" {
*/
#elif defined(__sparcv9)
/*
* Define the appropriate "processor characteristics"
*/
#define _LONG_ALIGNMENT 8
#define _LONG_DOUBLE_ALIGNMENT 16
#define _LONG_DOUBLE_COMPLEX_ALIGNMENT 16
#define _POINTER_ALIGNMENT 8
#define _MAX_ALIGNMENT 16
#define _LONG_LONG_ALIGNMENT_32 _LONG_LONG_ALIGNMENT
/*
* Define the appropriate "implementation choices"
*/
#if !defined(_LP64)
#error "_LP64 not defined"
#endif
#if !defined(_I32LPx)
#define _I32LPx
#endif
#define _MULTI_DATAMODEL
#else
#error "unknown SPARC version"

View File

@ -281,46 +281,6 @@ extern unsigned char bcd_to_byte[256];
#define INCR_COUNT(var, mutex) mutex_enter(mutex), (*(var))++, mutex_exit(mutex)
#define DECR_COUNT(var, mutex) mutex_enter(mutex), (*(var))--, mutex_exit(mutex)
/*
* Macros to declare bitfields - the order in the parameter list is
* Low to High - that is, declare bit 0 first. We only support 8-bit bitfields
* because if a field crosses a byte boundary it's not likely to be meaningful
* without reassembly in its nonnative endianness.
*/
#if defined(_BIT_FIELDS_LTOH)
#define DECL_BITFIELD2(_a, _b) \
uint8_t _a, _b
#define DECL_BITFIELD3(_a, _b, _c) \
uint8_t _a, _b, _c
#define DECL_BITFIELD4(_a, _b, _c, _d) \
uint8_t _a, _b, _c, _d
#define DECL_BITFIELD5(_a, _b, _c, _d, _e) \
uint8_t _a, _b, _c, _d, _e
#define DECL_BITFIELD6(_a, _b, _c, _d, _e, _f) \
uint8_t _a, _b, _c, _d, _e, _f
#define DECL_BITFIELD7(_a, _b, _c, _d, _e, _f, _g) \
uint8_t _a, _b, _c, _d, _e, _f, _g
#define DECL_BITFIELD8(_a, _b, _c, _d, _e, _f, _g, _h) \
uint8_t _a, _b, _c, _d, _e, _f, _g, _h
#elif defined(_BIT_FIELDS_HTOL)
#define DECL_BITFIELD2(_a, _b) \
uint8_t _b, _a
#define DECL_BITFIELD3(_a, _b, _c) \
uint8_t _c, _b, _a
#define DECL_BITFIELD4(_a, _b, _c, _d) \
uint8_t _d, _c, _b, _a
#define DECL_BITFIELD5(_a, _b, _c, _d, _e) \
uint8_t _e, _d, _c, _b, _a
#define DECL_BITFIELD6(_a, _b, _c, _d, _e, _f) \
uint8_t _f, _e, _d, _c, _b, _a
#define DECL_BITFIELD7(_a, _b, _c, _d, _e, _f, _g) \
uint8_t _g, _f, _e, _d, _c, _b, _a
#define DECL_BITFIELD8(_a, _b, _c, _d, _e, _f, _g, _h) \
uint8_t _h, _g, _f, _e, _d, _c, _b, _a
#else
#error One of _BIT_FIELDS_LTOH or _BIT_FIELDS_HTOL must be defined
#endif /* _BIT_FIELDS_LTOH */
#if !defined(_KMEMUSER) && !defined(offsetof)
/* avoid any possibility of clashing with <stddef.h> version */

View File

@ -47,31 +47,6 @@
typedef uint_t zoneid_t;
typedef int projid_t;
/*
* Definitions remaining from previous partial support for 64-bit file
* offsets. This partial support for devices greater than 2gb requires
* compiler support for long long.
*/
#ifdef _LONG_LONG_LTOH
typedef union {
offset_t _f; /* Full 64 bit offset value */
struct {
int32_t _l; /* lower 32 bits of offset value */
int32_t _u; /* upper 32 bits of offset value */
} _p;
} lloff_t;
#endif
#ifdef _LONG_LONG_HTOL
typedef union {
offset_t _f; /* Full 64 bit offset value */
struct {
int32_t _u; /* upper 32 bits of offset value */
int32_t _l; /* lower 32 bits of offset value */
} _p;
} lloff_t;
#endif
#include <sys/param.h> /* for NBBY */
#endif