From nobody Thu Oct 08 12:21:48 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4j0pyN6vl3z6vZC9 for ; Thu, 08 Oct 2026 12:21:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4j0pyN3Ykkz4MfX for ; Thu, 08 Oct 2026 12:21:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791462108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K/YgMtl4mQpAdndazrywzZEbLeFYeONScFuTwlp1grU=; b=F/6VETi+N4SLc00c64JWPGvwLJ3lzxJjmo0ba51yuwblI+it27yaz0cG2ZCWYxkbd6vasr fo9GFQgGzEwM697f+X9ZETvB0Ibif/0Y2+wfvwnyUXl0mylWzcGnm5I2gjEnbM9/lYNpyU 42wUpC0r5Dwbij5+OPpcb8T41FCW2YZy16Qi9Pg3da3bWOKwxGHzBhXZEWPGBCd3gMTBjC IFY6dBiqbXIdh4OrUoOJ0Nn1IrpyJMXcFA0cArBdZ5GHeInZyGw0D3m9eyOk0JUH61tFvC dKVxv/TjeMac4kBPrzscpFYRm8HshdS1GUJpvBW11tIzBw7xoDMSFnhoa7z9NA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791462108; b=lsV7NGlfwJf5nt1rfSADjAtr2j9y3F2xUh6X8COkiUz6sSGaS/0zTVQ4yz8s7iBYk8XcBL rSnI7MWbgZrSang7gl5DVWx1K/UD6YCDMdDhoPadiSV7oNyPFHlayrN5oHdJQEeZHOtZZJ +RlfABbJKFG/qugWA43zlddtlGWmlarye2VeblEc/91jbsLdTM8d/4/Dpt46JoDrCoVPIP eulJfln04/GUUuxBAkdMLmtgET1WYBMVxxJBgEX+BvpY2fsqGn4ZIWZXZKFxXrI4aH80Ic SyP94mrbgKCtRGe0KBdwb3bZ9TwO3pBjhUdSmVtWgFc9UZtGAd2cvK8zywdw+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791462108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K/YgMtl4mQpAdndazrywzZEbLeFYeONScFuTwlp1grU=; b=Pk1znPAlvz9v41aAnivl0GRE6NwHY5GCBUN9KJUWnvrLfnvG92FSBYJ8D2CQhOPMVXUBGV UsQ4DGbqwWaNkSgtU+SQZLOX/PiiJ1bruP/k782H6+m7Ru6517U2Ey1/b+J8SqITTvNg2R buGA6itYyre2eQl0Vrr3M3YCtqanxakvSo0jvCboUZEFYUdLpFVfZuj81KgfrJUNq5SR2V va1F7YHRnG2ECy+d5cc5g7gYmRzpm7PjVjegZ/Idr1pncoh/8f99CVo9Sj4Z3t3x8LiG9E +imSMUNjOlQRy7UQx6cp3uiKaTyEmxAp/UeAjARhQbJwrPduCBLG6b2iuuGBiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4j0pyN28t8zgFt for ; Thu, 08 Oct 2026 12:21:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1d8ab by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 08 Oct 2026 12:21:48 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 14be20344bbb - stable/15 - ifuncs: Have DEFINE_*IFUNC() macros expand the passed name List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 14be20344bbb4f4c74fdba970552fa609ca45059 Auto-Submitted: auto-generated Date: Thu, 08 Oct 2026 12:21:48 +0000 Message-Id: <6ac78adc.1d8ab.31ae71b1@gitrepo.freebsd.org> The branch stable/15 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=14be20344bbb4f4c74fdba970552fa609ca45059 commit 14be20344bbb4f4c74fdba970552fa609ca45059 Author: Olivier Certner AuthorDate: 2026-09-30 08:44:16 +0000 Commit: Olivier Certner CommitDate: 2026-10-08 12:20:08 +0000 ifuncs: Have DEFINE_*IFUNC() macros expand the passed name While here, make each header include so that it can be included standalone. Reviewed by: kib MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D60167 (cherry picked from commit ab9fcc5a553a25804b9535190e914e3ba0e746cf) --- sys/arm/include/ifunc.h | 18 +++++++++++------- sys/arm64/include/ifunc.h | 16 ++++++++++------ sys/powerpc/include/ifunc.h | 14 ++++++++------ sys/riscv/include/ifunc.h | 19 ++++++++++++------- sys/x86/include/ifunc.h | 18 +++++++++++------- 5 files changed, 52 insertions(+), 33 deletions(-) diff --git a/sys/arm/include/ifunc.h b/sys/arm/include/ifunc.h index 98cc354ae6ca..ec9e9281844d 100644 --- a/sys/arm/include/ifunc.h +++ b/sys/arm/include/ifunc.h @@ -8,17 +8,21 @@ #ifndef __ARM_IFUNC_H #define __ARM_IFUNC_H +#include + #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 + static ret_type (*__CONCAT(name, _resolver)(void))args __used; \ + qual ret_type name args \ + __attribute__((ifunc(__XSTRING(name) "_resolver"))); \ + static ret_type (*__CONCAT(name, _resolver)(void))args #ifdef __not_yet__ #define DEFINE_UIFUNC(qual, ret_type, name, args) \ - static ret_type (*name##_resolver(uint32_t, uint32_t, uint32_t, \ - uint32_t))args __used; \ - qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \ - static ret_type (*name##_resolver( \ + static ret_type (*__CONCAT(name, _resolver)(uint32_t, uint32_t, \ + uint32_t, uint32_t))args __used; \ + qual ret_type name args \ + __attribute__((ifunc(__XSTRING(name) "_resolver"))); \ + static ret_type (*__CONCAT(name, _resolver)( \ uint32_t elf_hwcap __unused, \ uint32_t elf_hwcap2 __unused, \ uint32_t arg3 __unused, \ diff --git a/sys/arm64/include/ifunc.h b/sys/arm64/include/ifunc.h index 34e783df8fe5..184c6394e02c 100644 --- a/sys/arm64/include/ifunc.h +++ b/sys/arm64/include/ifunc.h @@ -29,6 +29,8 @@ #ifndef __ARM64_IFUNC_H #define __ARM64_IFUNC_H +#include + struct __ifunc_arg_t { unsigned long _size; /* Size of the struct, so it can grow. */ @@ -43,17 +45,19 @@ 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 + static ret_type (*__CONCAT(name, _resolver)(void))args __used; \ + qual ret_type name args \ + __attribute__((ifunc(__XSTRING(name) "_resolver"))); \ + static ret_type (*__CONCAT(name, _resolver)(void))args #define DEFINE_UIFUNC(qual, ret_type, name, args) \ - static ret_type (*name##_resolver(uint64_t, \ + static ret_type (*__CONCAT(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( \ + qual ret_type name args \ + __attribute__((ifunc(__XSTRING(name) "_resolver"))); \ + static ret_type (*__CONCAT(name, _resolver)( \ uint64_t at_hwcap __unused, \ const struct __ifunc_arg_t *ifunc_arg __unused, \ uint64_t _arg3 __unused, \ diff --git a/sys/powerpc/include/ifunc.h b/sys/powerpc/include/ifunc.h index eac6019b07d7..c8f1f2a7462d 100644 --- a/sys/powerpc/include/ifunc.h +++ b/sys/powerpc/include/ifunc.h @@ -36,16 +36,18 @@ #include #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 + static ret_type (*__CONCAT(name, _resolver)(void))args __used; \ + qual ret_type name args \ + __attribute__((ifunc(__XSTRING(name) "_resolver"))); \ + static ret_type (*__CONCAT(name, _resolver)(void))args #define DEFINE_UIFUNC(qual, ret_type, name, args) \ - static ret_type (*name##_resolver(register_t, register_t, \ + static ret_type (*__CONCAT(name, _resolver)(register_t, register_t, \ register_t, register_t, register_t, register_t, register_t, \ register_t))args __used; \ - qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \ - static ret_type (*name##_resolver( \ + qual ret_type name args \ + __attribute__((ifunc(__XSTRING(name) "_resolver"))); \ + static ret_type (*__CONCAT(name, _resolver)( \ register_t cpu_features, \ register_t cpu_features2, \ register_t arg3 __unused, \ diff --git a/sys/riscv/include/ifunc.h b/sys/riscv/include/ifunc.h index 0f9747a2aa14..6efc437cca77 100644 --- a/sys/riscv/include/ifunc.h +++ b/sys/riscv/include/ifunc.h @@ -30,17 +30,22 @@ #ifndef __RISCV_IFUNC_H #define __RISCV_IFUNC_H +#include + #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 + static ret_type (*__CONCAT(name, _resolver)(void))args __used; \ + qual ret_type name args \ + __attribute__((ifunc(__XSTRING(name) "_resolver"))); \ + static ret_type (*__CONCAT(name, _resolver)(void))args #define DEFINE_UIFUNC(qual, ret_type, name, args) \ - static ret_type (*name##_resolver(unsigned long, unsigned long, \ + static ret_type (*__CONCAT(name, _resolver)(unsigned long, \ unsigned long, unsigned long, unsigned long, unsigned long, \ - unsigned long, unsigned long))args __used; \ - qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \ - static ret_type (*name##_resolver(unsigned long elf_hwcap __unused, \ + unsigned long, unsigned long, unsigned long))args __used; \ + qual ret_type name args \ + __attribute__((ifunc(__XSTRING(name) "_resolver"))); \ + static ret_type (*__CONCAT(name, _resolver) \ + (unsigned long elf_hwcap __unused, \ unsigned long _arg2 __unused, unsigned long _arg3 __unused, \ unsigned long _arg4 __unused, unsigned long _arg5 __unused, \ unsigned long _arg6 __unused, unsigned long _arg7 __unused, \ diff --git a/sys/x86/include/ifunc.h b/sys/x86/include/ifunc.h index 51b7cca1dc09..040dc6781aba 100644 --- a/sys/x86/include/ifunc.h +++ b/sys/x86/include/ifunc.h @@ -29,16 +29,20 @@ #ifndef __X86_IFUNC_H #define __X86_IFUNC_H +#include + #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 + static ret_type (*__CONCAT(name, _resolver)(void))args __used; \ + qual ret_type name args \ + __attribute__((ifunc(__XSTRING(name) "_resolver"))); \ + static ret_type (*__CONCAT(name, _resolver)(void))args #define DEFINE_UIFUNC(qual, ret_type, name, args) \ - static ret_type (*name##_resolver(uint32_t, uint32_t, uint32_t, \ - uint32_t))args __used; \ - qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \ - static ret_type (*name##_resolver( \ + static ret_type (*__CONCAT(name, _resolver) \ + (uint32_t, uint32_t, uint32_t, uint32_t))args __used; \ + qual ret_type name args \ + __attribute__((ifunc(__XSTRING(name) "_resolver"))); \ + static ret_type (*__CONCAT(name, _resolver)( \ uint32_t cpu_feature __unused, \ uint32_t cpu_feature2 __unused, \ uint32_t cpu_stdext_feature __unused, \