From: Brad Smith via ffmpeg-devel <ffmpeg-devel@ffmpeg.org> To: ffmpeg-devel@ffmpeg.org Cc: martin@martin.st, Brad Smith <brad@comstyle.com> Subject: [FFmpeg-devel] [PATCH] libavutil/arm: Make use of elf_aux_info() on FreeBSD/OpenBSD Date: Mon, 22 Sep 2025 07:19:20 -0400 Message-ID: <aNEwuJKwn3c1u3VM@humpty.home.comstyle.com> (raw) libavutil/arm: Make use of elf_aux_info() on FreeBSD/OpenBSD - FreBSD/OpenBSD have elf_aux_info() on arm - Wrap AT_HWCAP as the value is different for BSD vs Linux (16 vs 25) Signed-off-by: Brad Smith <brad@comstyle.com> --- libavutil/arm/cpu.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libavutil/arm/cpu.c b/libavutil/arm/cpu.c index b84882005a..8ec28143d7 100644 --- a/libavutil/arm/cpu.c +++ b/libavutil/arm/cpu.c @@ -31,18 +31,20 @@ CORE_FLAG(VFPV3) | \ CORE_FLAG(NEON)) -#if defined __linux__ || defined __ANDROID__ +#if defined __linux__ || defined __ANDROID__ || HAVE_ELF_AUX_INFO #include <stdint.h> #include <stdio.h> #include <string.h> #include "libavutil/avstring.h" -#if HAVE_GETAUXVAL +#if HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO #include <sys/auxv.h> #endif +#ifndef AT_HWCAP #define AT_HWCAP 16 +#endif /* Relevant HWCAP values from kernel headers */ #define HWCAP_VFP (1 << 6) @@ -54,7 +56,7 @@ static int get_auxval(uint32_t *hwcap) { -#if HAVE_GETAUXVAL +#if HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO unsigned long ret = ff_getauxval(AT_HWCAP); if (ret == 0) return -1; @@ -65,6 +67,7 @@ static int get_auxval(uint32_t *hwcap) #endif } +#if defined __linux__ || defined __ANDROID__ static int get_hwcap(uint32_t *hwcap) { struct { uint32_t a_type; uint32_t a_val; } auxv; @@ -117,6 +120,7 @@ static int get_cpuinfo(uint32_t *hwcap) fclose(f); return 0; } +#endif int ff_get_cpu_flags_arm(void) { @@ -124,8 +128,10 @@ int ff_get_cpu_flags_arm(void) uint32_t hwcap; if (get_auxval(&hwcap) < 0) +#if defined __linux__ || defined __ANDROID__ if (get_hwcap(&hwcap) < 0) if (get_cpuinfo(&hwcap) < 0) +#endif return flags; #define check_cap(cap, flag) do { \ -- 2.51.0 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
next reply other threads:[~2025-09-22 11:20 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2025-09-22 11:19 Brad Smith via ffmpeg-devel [this message] 2025-09-22 11:24 ` [FFmpeg-devel] " Martin Storsjö via ffmpeg-devel
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=aNEwuJKwn3c1u3VM@humpty.home.comstyle.com \ --to=ffmpeg-devel@ffmpeg.org \ --cc=brad@comstyle.com \ --cc=martin@martin.st \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror http://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ http://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git