From nobody Mon Oct 20 04:29:12 2025 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 4cqjB10gY0z6D99V; Mon, 20 Oct 2025 04:29:13 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cqjB074M5z3Cs5; Mon, 20 Oct 2025 04:29:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760934553; 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=N0mHy0AWxPnvuEjCnZOShUqCqJik1EcnROJhcYUoj2I=; b=NL+rSQEDtc5rK6WvU5Eru2KKsL4+nQsOI4YLjwJc5kqcDIdsyMCG64pVXqgDKOqrT0O3xP ab0ey40UYZaf1+FmMVn4lKHS2vIV7pWHyYhiOzXlXrD8RHzwi2uig1ONFTGXnD5OhyQsKy BWH+DjgwVAwMah1mB07nramWoF+WgnEd276q+9QAvikRw+GJWM3BzkmgVuUFl72yYpdUez 7lizV0mxk70sSATghQoU862oc8bgIV0rGH3WADCOufLjJRAh9TqnosIgPLtyP8tsrlswFZ KdIz3MVkR77yRL+Ks8g6d7ZIj7k+I7saOPPJRFV73tP4TN3XCdpW+eLF2y+YtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760934553; 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=N0mHy0AWxPnvuEjCnZOShUqCqJik1EcnROJhcYUoj2I=; b=yssr7ylr86bXsYoERzlc0LMedWi4Zsv8nreeJMjy9cVhrq/pOuRatTZrmFc/vcUOEvLbXu LzWNYiiDZOz8apVgqNo7ac1PVqiGyn4N8tBWZB/BSu3RtCU6omRhgfkU6BDaO+a59v10BQ ghaYP9/k2mg8ni6zgXTlvF3hRIYEy7ILasgsBeGqdhSWNLXqgHL+gaWUTVot0yltnsfbDq hIYLc3eLbhRidC3pe757G/1/K7UrX+w4JXc3KMzZTnI54lD/gro3LIzXNNdBFzR3CivvWl 2PMxcWdLJ7FkE5tm7vHXpvNUySRz+eE6HCQLCHC64tO+zSJKoXyUysLzeWU5JQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1760934553; a=rsa-sha256; cv=none; b=Y8C/Qmxi+i4ZeH10UextbfNFa30jmYp9ufwTLLLmLRyQyZ/rdphJtEiQCzyI7hYlaV3+ZN Mx9BUjaXhpKuiXZvDyc2c37/X6aZeZ77Ohia2QzPRLFLjX8zXZoBCSxZ979m+gKJOGJ+Ys O7EFl9sooC6PNCaUvk8LejmnTZdJfg00Jj0cbTvFoGJYBYtVmTqdC/AU2SOKQKT3QY8jlE EU/mVXhNGsyTr1mGWN1Q/SJ0Dazo7m2F1vEzBJbAWPlVcHaWVIrAxor7AsnAW/d+bZrBwu WG20oQ6khUaZMLihJw2k3doBlIJXoDWDrRjZw4acAzUaFUXJ4wsQ37W9gl5aww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cqjB06byxzy97; Mon, 20 Oct 2025 04:29:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59K4TCi2001835; Mon, 20 Oct 2025 04:29:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59K4TCqI001832; Mon, 20 Oct 2025 04:29:12 GMT (envelope-from git) Date: Mon, 20 Oct 2025 04:29:12 GMT Message-Id: <202510200429.59K4TCqI001832@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 790c27317ec1 - main - linux: Make the macro LINUX_IOCTL_SET public 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 790c27317ec1a997a4e5c2bdee9e4acc610c8e3c Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=790c27317ec1a997a4e5c2bdee9e4acc610c8e3c commit 790c27317ec1a997a4e5c2bdee9e4acc610c8e3c Author: Zhenlei Huang AuthorDate: 2025-10-20 04:28:41 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-20 04:28:41 +0000 linux: Make the macro LINUX_IOCTL_SET public There're some other drivers want to register and unregister linux ioctl handler. Move the macro LINUX_IOCTL_SET from tdfx_linux.h to linux_ioctl.h so that they can also benefit it. While here, rename the declaration of linux ioctl function to be consistent with the name of the handler. Meanwhile, drop a comment about the macro, since its function is obvious. Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D53158 --- sys/compat/linux/linux_ioctl.h | 12 ++++++++++++ sys/dev/tdfx/tdfx_linux.c | 2 +- sys/dev/tdfx/tdfx_linux.h | 12 ------------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sys/compat/linux/linux_ioctl.h b/sys/compat/linux/linux_ioctl.h index ccc25bc919ab..8345b7e4b719 100644 --- a/sys/compat/linux/linux_ioctl.h +++ b/sys/compat/linux/linux_ioctl.h @@ -823,4 +823,16 @@ int linux32_ioctl_register_handler(struct linux_ioctl_handler *h); int linux32_ioctl_unregister_handler(struct linux_ioctl_handler *h); #endif +#define LINUX_IOCTL_SET(n, low, high) \ +static linux_ioctl_function_t n##_linux_ioctl; \ +static struct linux_ioctl_handler n##_linux_handler = { \ + n##_linux_ioctl, \ + low, \ + high \ +}; \ +SYSINIT(n##_ioctl_register, SI_SUB_KLD, SI_ORDER_MIDDLE, \ + linux_ioctl_register_handler, &n##_linux_handler); \ +SYSUNINIT(n##_ioctl_unregister, SI_SUB_KLD, SI_ORDER_MIDDLE, \ + linux_ioctl_unregister_handler, &n##_linux_handler) + #endif /* !_LINUX_IOCTL_H_ */ diff --git a/sys/dev/tdfx/tdfx_linux.c b/sys/dev/tdfx/tdfx_linux.c index f3410106bad2..777144d21bb6 100644 --- a/sys/dev/tdfx/tdfx_linux.c +++ b/sys/dev/tdfx/tdfx_linux.c @@ -42,7 +42,7 @@ LINUX_IOCTL_SET(tdfx, LINUX_IOCTL_TDFX_MIN, LINUX_IOCTL_TDFX_MAX); * Linux emulation IOCTL for /dev/tdfx */ static int -linux_ioctl_tdfx(struct thread *td, struct linux_ioctl_args* args) +tdfx_linux_ioctl(struct thread *td, struct linux_ioctl_args* args) { cap_rights_t rights; int error = 0; diff --git a/sys/dev/tdfx/tdfx_linux.h b/sys/dev/tdfx/tdfx_linux.h index b87cb41f38fe..9d012c12274b 100644 --- a/sys/dev/tdfx/tdfx_linux.h +++ b/sys/dev/tdfx/tdfx_linux.h @@ -35,18 +35,6 @@ #include #include -/* - * This code was donated by Vladimir N. Silynaev to allow for defining - * ioctls within modules - */ -#define LINUX_IOCTL_SET(n,low,high) \ -static linux_ioctl_function_t linux_ioctl_##n; \ -static struct linux_ioctl_handler n##_handler = {linux_ioctl_##n, low, high}; \ -SYSINIT(n##register, SI_SUB_KLD, SI_ORDER_MIDDLE,\ -linux_ioctl_register_handler, &n##_handler); \ -SYSUNINIT(n##unregister, SI_SUB_KLD, SI_ORDER_MIDDLE,\ -linux_ioctl_unregister_handler, &n##_handler); - /* Values for /dev/3dfx */ /* Query IOCTLs */ #define LINUX_IOCTL_TDFX_QUERY_BOARDS 0x3302