From nobody Thu Oct 01 08:26:24 2026 X-Original-To: dev-commits-src-main@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 4hwQ410Cyvz6vGTp for ; Thu, 01 Oct 2026 08:26:25 +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 4hwQ406SHJz4dpB for ; Thu, 01 Oct 2026 08:26:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790843184; 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=M3XBEAclRzjcLppyZ0UAHdhmhkp2zNdozRBlV9myw+E=; b=pamLkwinkefGRZZBfN7Sig5xVciNzQ5R8QObfxadTxDTZ0X5K3k8l8a1I37/M2b0mtwWHC bgeVP33dqXtkwj5R0J5sypJzATyqBnVsmRzJFXeZHngVyB2v7vGb0vY5nFx44UCRIDbgdB cdFjF5FwgxkwVSZ7iV6L30aBqJaK6tF15xSOjjRaGPn0DGnVa9ok4bl8UbjE+QUUnMG8PR YAwwSGnEnX4KHJ/JVIIRJ3mfdIM0/JkZFyn85suoiMBuOjEH4d9upXi4+8ss4pE8iumZ8a Ie07MGt4e5EHoisa+N+z78/UXKG77SgQWSub4D9FblfbEDRxhV2Z1QUBDtEZew== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1790843184; b=fhsK5dHs/0omC4IeSMQAO830hFUNw3LMvn7AL7m6DOw66PbBYHhkclmq/oDnOV/h3Zj1Gb 6w5WJwAEXd5vgGJiU5ALLX0IYrHh3EFU4zNKoF3K1IY0p09eqOeoEAKcaqZkrNwov/Grmn 9rdny7Df/ik8MBQtbesrov7ztWeCnWl3u0XGK0QD599dlMGhkyGSzty848PG6rnPBYmrsL oChTrxvU890bNfUg9fZWCMuzKnFOnwh/HZyja6JeE/oyXKgWatNPIJlSmLj5J7BBAN4bQ9 nBjJKMm6DRDVVlMHfKJrPKSFwN+eukZ4874g9YaFCJTWErmpJCx7WvLYKTamig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790843184; 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=M3XBEAclRzjcLppyZ0UAHdhmhkp2zNdozRBlV9myw+E=; b=R1GmA6VHclzMF9VFYmh4gg1zVhW93PGCpyjzdmBcE6YZS3cixrDDz6uRf3NkQzVmp140Fq /uWGOCckKETeM/vnflitX49fqvsu11Md5ZplwWMA/+f7lhRhM4QtPU4HqnOkzHjaabVNv9 2tgSrGkrpDrPuexuCbG5AD/HS7l0OYQH6wq/jpRiq5AVSh75s3OxKQHRJzcF9ekXaRsipG OI5qoU5wZEVFWIhjuc4mJi9kVZQbzdahSCg0XodCCvDaTP/zBLpmd3sd5Asu83FFtZOEc1 RKRcqcFwcAEXEAB7A2Fajb3m5PG8HIfotNEqagNw45kIiDQhnysJhnBTNGu/JQ== 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 4hwQ405WTlzNFD for ; Thu, 01 Oct 2026 08:26:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 273e9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 01 Oct 2026 08:26:24 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: ab9fcc5a553a - main - ifuncs: Have DEFINE_*IFUNC() macros expand the passed name List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: ab9fcc5a553a25804b9535190e914e3ba0e746cf Auto-Submitted: auto-generated Date: Thu, 01 Oct 2026 08:26:24 +0000 Message-Id: <6abe1930.273e9.290028de@gitrepo.freebsd.org> The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=ab9fcc5a553a25804b9535190e914e3ba0e746cf commit ab9fcc5a553a25804b9535190e914e3ba0e746cf Author: Olivier Certner AuthorDate: 2026-09-30 08:44:16 +0000 Commit: Olivier Certner CommitDate: 2026-10-01 08:23:29 +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 --- 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, \