git: 449339bdba24 - main - arm64: Provide ifunc HWCAP structure definitions

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Tue, 13 Jan 2026 17:00:49 UTC
The branch main has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=449339bdba2470eded4d55c41b084cfc8f5ef73a

commit 449339bdba2470eded4d55c41b084cfc8f5ef73a
Author:     Sarah Walker <sarah.walker2@arm.com>
AuthorDate: 2026-01-13 14:19:56 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2026-01-13 15:28:04 +0000

    arm64: Provide ifunc HWCAP structure definitions
    
    IFUNC structure is based on Section 9.4.1 "GNU C Library IFUNC interface"
    from "System V ABI for the Arm 64-bit Architecture (AArch64)", 2025Q1.
    (https://github.com/ARM-software/abi-aa/releases/download/2025Q1/sysvabi64.pdf)
    
    Reviewed by:    andrew
    Sponsored by:   Arm Ltd
    Differential Revision:  https://reviews.freebsd.org/D54598
---
 sys/arm64/include/ifunc.h | 28 +++++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/sys/arm64/include/ifunc.h b/sys/arm64/include/ifunc.h
index de452ad34c8f..34e783df8fe5 100644
--- a/sys/arm64/include/ifunc.h
+++ b/sys/arm64/include/ifunc.h
@@ -29,20 +29,38 @@
 #ifndef __ARM64_IFUNC_H
 #define	__ARM64_IFUNC_H
 
+struct __ifunc_arg_t
+{
+	unsigned long _size; /* Size of the struct, so it can grow. */
+	unsigned long _hwcap;
+	unsigned long _hwcap2;
+	unsigned long _hwcap3;
+	unsigned long _hwcap4;
+};
+
+typedef struct __ifunc_arg_t __ifunc_arg_t;
+
+#define _IFUNC_ARG_HWCAP (1ULL << 62)
+
 #define	DEFINE_IFUNC(qual, ret_type, name, args)			\
     static ret_type (*name##_resolver(void))args __used;		\
     qual ret_type name args __attribute__((ifunc(#name "_resolver")));	\
     static ret_type (*name##_resolver(void))args
 
 #define	DEFINE_UIFUNC(qual, ret_type, name, args)			\
-    static ret_type (*name##_resolver(uint64_t, uint64_t,		\
+    static ret_type (*name##_resolver(uint64_t,				\
+	const struct __ifunc_arg_t *ifunc_arg,				\
 	uint64_t, uint64_t, uint64_t, uint64_t, uint64_t,		\
 	uint64_t))args __used;						\
     qual ret_type name args __attribute__((ifunc(#name "_resolver")));	\
-    static ret_type (*name##_resolver(uint64_t _arg1 __unused,		\
-	uint64_t _arg2 __unused, uint64_t _arg3 __unused,		\
-	uint64_t _arg4 __unused, uint64_t _arg5 __unused,		\
-	uint64_t _arg6 __unused, uint64_t _arg7 __unused,		\
+    static ret_type (*name##_resolver(					\
+	uint64_t at_hwcap __unused,					\
+	const struct __ifunc_arg_t *ifunc_arg __unused,			\
+	uint64_t _arg3 __unused,					\
+	uint64_t _arg4 __unused,					\
+	uint64_t _arg5 __unused,					\
+	uint64_t _arg6 __unused,					\
+	uint64_t _arg7 __unused,					\
 	uint64_t _arg8 __unused))args
 
 #endif