[PATCH 08/14] bsd-user/target_os_elf: If ELF_HWCAP2 is defined, publish it

Warner Losh posted 14 patches 4 years, 4 months ago
Maintainers: Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>
There is a newer version of this series
[PATCH 08/14] bsd-user/target_os_elf: If ELF_HWCAP2 is defined, publish it
Posted by Warner Losh 4 years, 4 months ago
Some architecutres publish AT_HWCAP2 as well as AT_HWCAP. Those
architectures will define this in their target_arch_elf.h files.  If it
is defined, then publish it.

Signed-off-by: Warner Losh <imp@bsdimp.com>
---
 bsd-user/freebsd/target_os_elf.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bsd-user/freebsd/target_os_elf.h b/bsd-user/freebsd/target_os_elf.h
index adcffd1ddb..e5ac8e8e50 100644
--- a/bsd-user/freebsd/target_os_elf.h
+++ b/bsd-user/freebsd/target_os_elf.h
@@ -112,6 +112,10 @@ static abi_ulong target_create_elf_tables(abi_ulong p, int argc, int envc,
         NEW_AUX_ENT(AT_ENTRY, load_bias + exec->e_entry);
         features = ELF_HWCAP;
         NEW_AUX_ENT(FREEBSD_AT_HWCAP, features);
+#ifdef ELF_HWCAP2
+        features = ELF_HWCAP2;
+        NEW_AUX_ENT(FREEBSD_AT_HWCAP2, features);
+#endif
         NEW_AUX_ENT(AT_UID, (abi_ulong)getuid());
         NEW_AUX_ENT(AT_EUID, (abi_ulong)geteuid());
         NEW_AUX_ENT(AT_GID, (abi_ulong)getgid());
-- 
2.32.0


Re: [PATCH 08/14] bsd-user/target_os_elf: If ELF_HWCAP2 is defined, publish it
Posted by Philippe Mathieu-Daudé 4 years, 4 months ago
On 9/22/21 08:14, Warner Losh wrote:
> Some architecutres publish AT_HWCAP2 as well as AT_HWCAP. Those

Typo "architectures"

> architectures will define this in their target_arch_elf.h files.  If it
> is defined, then publish it.
> 
> Signed-off-by: Warner Losh <imp@bsdimp.com>
> ---
>   bsd-user/freebsd/target_os_elf.h | 4 ++++
>   1 file changed, 4 insertions(+)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Re: [PATCH 08/14] bsd-user/target_os_elf: If ELF_HWCAP2 is defined, publish it
Posted by Richard Henderson 4 years, 4 months ago
On 9/21/21 11:14 PM, Warner Losh wrote:
> Some architecutres publish AT_HWCAP2 as well as AT_HWCAP. Those
> architectures will define this in their target_arch_elf.h files.  If it
> is defined, then publish it.
> 
> Signed-off-by: Warner Losh<imp@bsdimp.com>
> ---
>   bsd-user/freebsd/target_os_elf.h | 4 ++++
>   1 file changed, 4 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~