From nobody Fri May 15 01:10:27 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 4gGpzD6234z6cVBF for ; Fri, 15 May 2026 01:10:32 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gGpzD5Hzwz42Sm for ; Fri, 15 May 2026 01:10:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778807432; 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=hQf8y5Om6uVWQfhltnplLZmrhhBQFxBaZXFiqmgo05s=; b=cWx3LR0gdJb39Tch8EAEfeWwkwHuw/+f3ervWm3iKatBlJSyy27vpJb5S8OOxYH0PqYEEG Sdh3WksG5tqxRmQOfH/H1eGXP6cs20k5DXOicDE45vvzXE/4ohJ5B9WVpRnAQAYhLQmMBL IKyA+Ny5TH4K0SVwPhsol1BplyPkmH4OZocM/ykAo7aS57Vl5wQdC/SA4R1XVVfc4Rfi6u yn+q7jY9jxPN+igXd9CC5CkQ6cz6xv+wSQaQVGgMx8xjfB7I236+we6R8JDgIukooRj9Xw ATFSsxs8pU2widcg4wrTjHlLpY5+4/qdwWfZTa4021shfBKKqzdOlQGstf5jbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1778807432; a=rsa-sha256; cv=none; b=T96zVV8ET+nCFyLaiQr+nOEdvhQZp7nOwydyHggwY4KtNhFD1P4NUVNwBnw39/h1qKBkon hztkZzWy+hNyEr5QG9VkZ1kmF9LiTGRPbRGS/tr2DX4e9Ras4T+pQMUIIzd8mNdIjzbCMK AAEbnygsAnca0Ig60Denl1giaQKAAov8Ag5sUzLTYngZiMgXIjYZRn4Jj6BgnnPTFxfwNb BJEERGp2dGl4oiarQUUcbMBDe9ObnCZSFX8MFONZYnxEhTVcFlyEtkeI34oIGYP1g+bUIL aAzC/8yBbaruMVotxetR27FzKdwd+UYDACk3kbQDxcGclCNGYNItjxJFZG6n7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778807432; 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=hQf8y5Om6uVWQfhltnplLZmrhhBQFxBaZXFiqmgo05s=; b=WeHpPQV78iD3TbiJzfzNKgnPRU9aQBNxu/PDN4ACrtlI9N/sp0FUmfEOoAboVJFeM4Cyj+ atJeggLq7Mh2oXScFl58qU5k9LZRvkKp7DnG3xVvlYRpgW2nmFVFmT8C38CNPCUq60/A9b 2OkEnqzCUALdzp62ML3RoGqo4DibyVvYMUQc+btT2tfxtHOvKRAvrV3WkGLBZ2HleP18ne frfzc9xfDja/h34Y1AdAuys3PVtj5WwqJS6n5ae18HT3HG5Zo8aeSbxhNLLna4OQgOynGM 3avYsx+HwZbIE0ikD7/Vt8KpWrw6yyrhxo/WMuC05jCd4Pg31YiiYNZRkmG3ng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gGpzD4sgPz11tV for ; Fri, 15 May 2026 01:10:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22cf0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 15 May 2026 01:10:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: b99954433d42 - main - linux: Fix some problems with header pollution 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b99954433d42d978b257e846dbfe568e9af7b140 Auto-Submitted: auto-generated Date: Fri, 15 May 2026 01:10:27 +0000 Message-Id: <6a067283.22cf0.6eb8afc4@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b99954433d42d978b257e846dbfe568e9af7b140 commit b99954433d42d978b257e846dbfe568e9af7b140 Author: Mark Johnston AuthorDate: 2026-05-15 00:39:25 +0000 Commit: Mark Johnston CommitDate: 2026-05-15 00:39:25 +0000 linux: Fix some problems with header pollution - Avoid including sys/proc.h in linux_vdso_gtod.c. It's not needed, but the implicit inclusion of sys/param.h via sys/ucred.h->bsm/audit.h was bringing in some required definitions. - Include a couple of required headers: sys/time.h (for struct bintime), and limits.h (for INT_MAX). - Move some helpers from linux.h, which depend on sys/param.h for NODEV, to the one CU where they're actually used. No functional change intended. Reviewed by: imp, kib, emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D56982 --- sys/amd64/linux/linux_vdso_gtod.c | 4 ++- sys/amd64/linux32/linux32_vdso_gtod.c | 4 ++- sys/arm64/linux/linux_vdso_gtod.c | 4 ++- sys/compat/linux/linux.h | 50 ----------------------------------- sys/compat/linux/linux_stats.c | 46 ++++++++++++++++++++++++++++++++ sys/i386/linux/linux_vdso_gtod.c | 4 ++- 6 files changed, 58 insertions(+), 54 deletions(-) diff --git a/sys/amd64/linux/linux_vdso_gtod.c b/sys/amd64/linux/linux_vdso_gtod.c index abe42d51a3ac..12c5c96dcead 100644 --- a/sys/amd64/linux/linux_vdso_gtod.c +++ b/sys/amd64/linux/linux_vdso_gtod.c @@ -27,12 +27,14 @@ #include #include -#include #include #include +#include #define _KERNEL #include #undef _KERNEL + +#include #include #include diff --git a/sys/amd64/linux32/linux32_vdso_gtod.c b/sys/amd64/linux32/linux32_vdso_gtod.c index f32db30057d0..ff4b372ea3bc 100644 --- a/sys/amd64/linux32/linux32_vdso_gtod.c +++ b/sys/amd64/linux32/linux32_vdso_gtod.c @@ -27,12 +27,14 @@ #include #include -#include #include #include +#include #define _KERNEL #include #undef _KERNEL + +#include #include #include diff --git a/sys/arm64/linux/linux_vdso_gtod.c b/sys/arm64/linux/linux_vdso_gtod.c index 203c76b6e3a9..55f039b74593 100644 --- a/sys/arm64/linux/linux_vdso_gtod.c +++ b/sys/arm64/linux/linux_vdso_gtod.c @@ -28,12 +28,14 @@ #include #include -#include #include #include +#include #define _KERNEL #include #undef _KERNEL + +#include #include #include diff --git a/sys/compat/linux/linux.h b/sys/compat/linux/linux.h index 67acd726a503..a9f753cd55b7 100644 --- a/sys/compat/linux/linux.h +++ b/sys/compat/linux/linux.h @@ -28,58 +28,8 @@ #ifndef _LINUX_MI_H_ #define _LINUX_MI_H_ -/* - * Machine independent set of types for the Linux types. - */ typedef uint32_t l_dev_t; -/* - * Linux dev_t conversion routines. - * - * As of version 2.6.0 of the Linux kernel, dev_t is a 32-bit quantity - * with 12 bits set asaid for the major number and 20 for the minor number. - * The in-kernel dev_t encoded as MMMmmmmm, where M is a hex digit of the - * major number and m is a hex digit of the minor number. - * The user-space dev_t encoded as mmmM MMmm, where M and m is the major - * and minor numbers accordingly. This is downward compatible with legacy - * systems where dev_t is 16 bits wide, encoded as MMmm. - * In glibc dev_t is a 64-bit quantity, with 32-bit major and minor numbers, - * encoded as MMMM Mmmm mmmM MMmm. This is downward compatible with the Linux - * kernel and with legacy systems where dev_t is 16 bits wide. - * - * In the FreeBSD dev_t is a 64-bit quantity. The major and minor numbers - * are encoded as MMMmmmMm, therefore conversion of the device numbers between - * Linux user-space and FreeBSD kernel required. - */ -static __inline l_dev_t -linux_encode_dev(int _major, int _minor) -{ - - return ((_minor & 0xff) | ((_major & 0xfff) << 8) | - (((_minor & ~0xff) << 12) & 0xfff00000)); -} - -static __inline l_dev_t -linux_new_encode_dev(dev_t _dev) -{ - - return (_dev == NODEV ? 0 : linux_encode_dev(major(_dev), minor(_dev))); -} - -static __inline int -linux_encode_major(dev_t _dev) -{ - - return (_dev == NODEV ? 0 : major(_dev) & 0xfff); -} - -static __inline int -linux_encode_minor(dev_t _dev) -{ - - return (_dev == NODEV ? 0 : minor(_dev) & 0xfffff); -} - static __inline int linux_decode_major(l_dev_t _dev) { diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c index 6f96a219003b..5ac9394f3601 100644 --- a/sys/compat/linux/linux_stats.c +++ b/sys/compat/linux/linux_stats.c @@ -58,6 +58,52 @@ #include #include +/* + * Linux dev_t conversion routines. + * + * As of version 2.6.0 of the Linux kernel, dev_t is a 32-bit quantity + * with 12 bits set asaid for the major number and 20 for the minor number. + * The in-kernel dev_t encoded as MMMmmmmm, where M is a hex digit of the + * major number and m is a hex digit of the minor number. + * The user-space dev_t encoded as mmmM MMmm, where M and m is the major + * and minor numbers accordingly. This is downward compatible with legacy + * systems where dev_t is 16 bits wide, encoded as MMmm. + * In glibc dev_t is a 64-bit quantity, with 32-bit major and minor numbers, + * encoded as MMMM Mmmm mmmM MMmm. This is downward compatible with the Linux + * kernel and with legacy systems where dev_t is 16 bits wide. + * + * In the FreeBSD dev_t is a 64-bit quantity. The major and minor numbers + * are encoded as MMMmmmMm, therefore conversion of the device numbers between + * Linux user-space and FreeBSD kernel required. + */ +static l_dev_t +linux_encode_dev(int _major, int _minor) +{ + + return ((_minor & 0xff) | ((_major & 0xfff) << 8) | + (((_minor & ~0xff) << 12) & 0xfff00000)); +} + +static l_dev_t +linux_new_encode_dev(dev_t _dev) +{ + + return (_dev == NODEV ? 0 : linux_encode_dev(major(_dev), minor(_dev))); +} + +static int +linux_encode_major(dev_t _dev) +{ + + return (_dev == NODEV ? 0 : major(_dev) & 0xfff); +} + +static int +linux_encode_minor(dev_t _dev) +{ + + return (_dev == NODEV ? 0 : minor(_dev) & 0xfffff); +} static int linux_kern_fstat(struct thread *td, int fd, struct stat *sbp) diff --git a/sys/i386/linux/linux_vdso_gtod.c b/sys/i386/linux/linux_vdso_gtod.c index 00367d82139e..336f8d4c290d 100644 --- a/sys/i386/linux/linux_vdso_gtod.c +++ b/sys/i386/linux/linux_vdso_gtod.c @@ -27,12 +27,14 @@ #include #include -#include #include #include +#include #define _KERNEL #include #undef _KERNEL + +#include #include #include