arm64: fix incorrect HWCAP definitions
FreeBSD exports CPU features as bits in the AT_HWCAP and AT_HWCAP2 vectors via elf_aux_info(3). This interface is similar to getauxval(3) on Linux, and for simplicity to consumers we try to maintain an identical set of feature flags on arm64. The first batch of AT_HWCAP flags were added in r350166, corresponding to definitions that already existed in Linux. Unfortunately, one flag was missed, and a portion of the values are shifted one bit to the right as a result. Add the missing definition for HWCAP_ASIMDHP, and adjust the affected values to match their Linux counterparts. Although this is an ABI-breaking change, there is no plan to provide compat code for old binaries. An audit of our ports tree and other software via Debian code search indicates that there are not yet any consumers of this interface for FreeBSD/arm64. Bump __FreeBSD_version to be on the safe side, in case compat code needs to be added in the future. Reviewed by: emaste, manu MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26329
This commit is contained in:
parent
2d955e4199
commit
d81d009c6c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=365459
@ -102,25 +102,29 @@ __ElfType(Auxinfo);
|
||||
#define HWCAP_CRC32 0x00000080
|
||||
#define HWCAP_ATOMICS 0x00000100
|
||||
#define HWCAP_FPHP 0x00000200
|
||||
/* XXX: The following bits don't match the Linux definitions */
|
||||
#define HWCAP_CPUID 0x00000400
|
||||
#define HWCAP_ASIMDRDM 0x00000800
|
||||
#define HWCAP_JSCVT 0x00001000
|
||||
#define HWCAP_FCMA 0x00002000
|
||||
#define HWCAP_LRCPC 0x00004000
|
||||
#define HWCAP_DCPOP 0x00008000
|
||||
#define HWCAP_SHA3 0x00010000
|
||||
#define HWCAP_SM3 0x00020000
|
||||
#define HWCAP_SM4 0x00040000
|
||||
#define HWCAP_ASIMDDP 0x00080000
|
||||
#define HWCAP_SHA512 0x00100000
|
||||
#define HWCAP_SVE 0x00200000
|
||||
#define HWCAP_ASIMDFHM 0x00400000
|
||||
#define HWCAP_DIT 0x00800000
|
||||
#define HWCAP_USCAT 0x01000000
|
||||
#define HWCAP_ILRCPC 0x02000000
|
||||
#define HWCAP_FLAGM 0x04000000
|
||||
/* XXX: end of incorrect definitions */
|
||||
#define HWCAP_ASIMDHP 0x00000400
|
||||
/*
|
||||
* XXX: The following bits (from CPUID to FLAGM) were originally incorrect,
|
||||
* but later changed to match the Linux definitions. No compatibility code is
|
||||
* provided, as the fix was expected to result in near-zero fallout.
|
||||
*/
|
||||
#define HWCAP_CPUID 0x00000800
|
||||
#define HWCAP_ASIMDRDM 0x00001000
|
||||
#define HWCAP_JSCVT 0x00002000
|
||||
#define HWCAP_FCMA 0x00004000
|
||||
#define HWCAP_LRCPC 0x00008000
|
||||
#define HWCAP_DCPOP 0x00010000
|
||||
#define HWCAP_SHA3 0x00020000
|
||||
#define HWCAP_SM3 0x00040000
|
||||
#define HWCAP_SM4 0x00080000
|
||||
#define HWCAP_ASIMDDP 0x00100000
|
||||
#define HWCAP_SHA512 0x00200000
|
||||
#define HWCAP_SVE 0x00400000
|
||||
#define HWCAP_ASIMDFHM 0x00800000
|
||||
#define HWCAP_DIT 0x01000000
|
||||
#define HWCAP_USCAT 0x02000000
|
||||
#define HWCAP_ILRCPC 0x04000000
|
||||
#define HWCAP_FLAGM 0x08000000
|
||||
#define HWCAP_SSBS 0x10000000
|
||||
#define HWCAP_SB 0x20000000
|
||||
#define HWCAP_PACA 0x40000000
|
||||
|
@ -60,7 +60,7 @@
|
||||
* in the range 5 to 9.
|
||||
*/
|
||||
#undef __FreeBSD_version
|
||||
#define __FreeBSD_version 1300113 /* Master, propagated to newvers */
|
||||
#define __FreeBSD_version 1300114 /* Master, propagated to newvers */
|
||||
|
||||
/*
|
||||
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
|
||||
|
Loading…
Reference in New Issue
Block a user