diff options
| author | Sarah Walker <sarah.walker2@arm.com> | 2026-01-13 14:19:56 +0000 |
|---|---|---|
| committer | Andrew Turner <andrew@FreeBSD.org> | 2026-01-13 15:28:04 +0000 |
| commit | 449339bdba2470eded4d55c41b084cfc8f5ef73a (patch) | |
| tree | db7d6559664a77323d95d924840222bfabebcbfd | |
| parent | 591c7a08bf8addce4b047ef9c8033c33099e4688 (diff) | |
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
| -rw-r--r-- | sys/arm64/include/ifunc.h | 28 |
1 files 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 |
