U7+M=; b=ItwHiI3iF5tB2ptYlHxFVU00wOhq+t15evT4KeZJoVvszofRT4kd1rteTWTMNEbNVpG1Jr h8hz5Jy65o/32+ulJ5kvy9A7d04bjTRUF0TcaQ/wlmOvLVsEMuRM8OhReBF4fV4ghN6nfS a1Bo95An0OjSU6R+hnHtcKLKaAEz7/rD3+riAZtdrLUd0fFlkoAM0vosd4p7WHBWEJI+nX rJowvusePowyIWHOD48/ZkBAS1Vb2uebJ4vtKngz9YnmKoa9+nkUeofkbpWuAljqJil7MM 7eWdD2vfZFAAVbbRV01GDre2UaldeBJmmO33ota2x1O3GZxTWu/dEQe34UEwxg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818006; a=rsa-sha256; cv=none; b=BpODQmIEIL2n8ymO4lb3U+ONYuc1MnPV2MU4mjn19S8OA4L300a3X9/WjN0nDk3E14Vx0G 1JIMLpAUNDb4a6raMq6sYRe57ArTSbD7tf1IB/a1fZ2OMIcwehTBl3EVWTUOyHPP++AbTy X796a1Fn6MmEgfj1g0KZ4aPj5A5mnfHOwrMscjIB7/RvjzOVrmHnHiOz1UBbOE91V7UMXK foTIXhJlwS0H6dQ4lBmVnDpk9fuQMmFfqLh+HhLc8L2wk/c5cy1P0PIDZ4LdVaO9W4/up/ iq1kvB4keAjJkEbh3tkuZGvQT7jyaSDKPs3zmspyvQqtZ+wia1eJ6iAh7SnLcg== 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 4dVRBZ1K9wzCtP for ; Mon, 15 Dec 2025 17:00:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id dda5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: c700f3b25298 - stable/14 - riscv: Add machine/ifunc.h corresponding to rtld-elf's resolver interface 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c700f3b2529833cc0de9d2ca461bee0e44afb9cc Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:06 +0000 Message-Id: <69403e96.dda5.a7891b0@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=c700f3b2529833cc0de9d2ca461bee0e44afb9cc commit c700f3b2529833cc0de9d2ca461bee0e44afb9cc Author: Jessica Clarke AuthorDate: 2024-08-22 19:36:45 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:43 +0000 riscv: Add machine/ifunc.h corresponding to rtld-elf's resolver interface Reviewed by: kib, mhorne MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46279 (cherry picked from commit 8afae0caf4c4816eb56b732fcd1a4b185e86098a) --- sys/riscv/include/ifunc.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/sys/riscv/include/ifunc.h b/sys/riscv/include/ifunc.h new file mode 100644 index 000000000000..0f9747a2aa14 --- /dev/null +++ b/sys/riscv/include/ifunc.h @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2015-2018 The FreeBSD Foundation + * Copyright (c) 2024 Jessica Clarke + * + * Part of this software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef __RISCV_IFUNC_H +#define __RISCV_IFUNC_H + +#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(unsigned long, 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 _arg2 __unused, unsigned long _arg3 __unused, \ + unsigned long _arg4 __unused, unsigned long _arg5 __unused, \ + unsigned long _arg6 __unused, unsigned long _arg7 __unused, \ + unsigned long _arg8 __unused))args + +#endif