Add AT_HWCAP2 ELF auxiliary vector.

- allocate value for new AT_HWCAP2 auxiliary vector on all platforms.
 - expand 'struct sysentvec' by new 'u_long *sv_hwcap2', in exactly
   same way as for AT_HWCAP.

MFC after:	1 month
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D12699
This commit is contained in:
Michal Meloun 2017-10-21 12:05:01 +00:00
parent 2efbd10ade
commit 904d8c492f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=324814
9 changed files with 19 additions and 8 deletions

View File

@ -86,8 +86,9 @@ __ElfType(Auxinfo);
#define AT_STACKPROT 23 /* Initial stack protection. */
#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */
#define AT_HWCAP 25 /* CPU feature flags. */
#define AT_HWCAP2 26 /* CPU feature flags 2. */
#define AT_COUNT 26 /* Count of defined aux entry types. */
#define AT_COUNT 27 /* Count of defined aux entry types. */
#define R_ARM_COUNT 33 /* Count of defined relocation types. */

View File

@ -92,8 +92,9 @@ __ElfType(Auxinfo);
#define AT_STACKPROT 23 /* Initial stack protection. */
#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */
#define AT_HWCAP 25 /* CPU feature flags. */
#define AT_HWCAP2 26 /* CPU feature flags 2. */
#define AT_COUNT 26 /* Count of defined aux entry types. */
#define AT_COUNT 27 /* Count of defined aux entry types. */
/* Define "machine" characteristics */
#define ELF_TARG_CLASS ELFCLASS64

View File

@ -1133,6 +1133,8 @@ __elfN(freebsd_fixup)(register_t **stack_base, struct image_params *imgp)
imgp->sysent->sv_stackprot);
if (imgp->sysent->sv_hwcap != NULL)
AUXARGS_ENTRY(pos, AT_HWCAP, *imgp->sysent->sv_hwcap);
if (imgp->sysent->sv_hwcap2 != NULL)
AUXARGS_ENTRY(pos, AT_HWCAP2, *imgp->sysent->sv_hwcap2);
AUXARGS_ENTRY(pos, AT_NULL, 0);
free(imgp->auxargs, M_TEMP);

View File

@ -146,8 +146,9 @@ __ElfType(Auxinfo);
#define AT_STACKPROT 23 /* Initial stack protection. */
#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */
#define AT_HWCAP 25 /* CPU feature flags. */
#define AT_HWCAP2 26 /* CPU feature flags 2. */
#define AT_COUNT 26 /* Count of defined aux entry types. */
#define AT_COUNT 27 /* Count of defined aux entry types. */
#define ET_DYN_LOAD_ADDR 0x0120000

View File

@ -109,8 +109,9 @@ __ElfType(Auxinfo);
#define AT_TIMEKEEP 22 /* Pointer to timehands. */
#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */
#define AT_HWCAP 25 /* CPU feature flags. */
#define AT_HWCAP2 26 /* CPU feature flags 2. */
#define AT_COUNT 26 /* Count of defined aux entry types. */
#define AT_COUNT 27 /* Count of defined aux entry types. */
/*
* Relocation types.

View File

@ -92,8 +92,9 @@ __ElfType(Auxinfo);
#define AT_STACKPROT 23 /* Initial stack protection. */
#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */
#define AT_HWCAP 25 /* CPU feature flags. */
#define AT_HWCAP2 26 /* CPU feature flags 2. */
#define AT_COUNT 26 /* Count of defined aux entry types. */
#define AT_COUNT 27 /* Count of defined aux entry types. */
/* Define "machine" characteristics */
#define ELF_TARG_CLASS ELFCLASS64

View File

@ -94,8 +94,9 @@ __ElfType(Auxinfo);
#define AT_STACKPROT 23 /* Initial stack protection. */
#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */
#define AT_HWCAP 25 /* CPU feature flags. */
#define AT_HWCAP2 26 /* CPU feature flags 2. */
#define AT_COUNT 26 /* Count of defined aux entry types. */
#define AT_COUNT 27 /* Count of defined aux entry types. */
/* Define "machine" characteristics */
#if __ELF_WORD_SIZE == 32

View File

@ -130,6 +130,7 @@ struct sysentvec {
void (*sv_thread_detach)(struct thread *);
int (*sv_trap)(struct thread *);
u_long *sv_hwcap; /* Value passed in AT_HWCAP. */
u_long *sv_hwcap2; /* Value passed in AT_HWCAP2. */
};
#define SV_ILP32 0x000100 /* 32-bit executable. */

View File

@ -102,8 +102,9 @@ __ElfType(Auxinfo);
#define AT_STACKPROT 23 /* Initial stack protection. */
#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */
#define AT_HWCAP 25 /* CPU feature flags. */
#define AT_HWCAP2 26 /* CPU feature flags 2. */
#define AT_COUNT 26 /* Count of defined aux entry types. */
#define AT_COUNT 27 /* Count of defined aux entry types. */
/*
* Relocation types.
@ -189,8 +190,9 @@ __ElfType(Auxinfo);
#define AT_STACKPROT 23 /* Initial stack protection. */
#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */
#define AT_HWCAP 25 /* CPU feature flags. */
#define AT_HWCAP2 26 /* CPU feature flags 2. */
#define AT_COUNT 26 /* Count of defined aux entry types. */
#define AT_COUNT 27 /* Count of defined aux entry types. */
/*
* Relocation types.