From nobody Mon Jan 5 20:09:25 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 4dlQPK6SVqz6N07D for ; Mon, 05 Jan 2026 20:09: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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dlQPK305Fz3Qj4 for ; Mon, 05 Jan 2026 20:09:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1767643765; 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=w+kDjQTWmNU3sBbBHHFZv/EHLD46/hjDmSqe9nqZWeY=; b=E4l+tm8aLu8ms/qYtIbDr15eHdgs1q8OetjCse5xDgMwLmSL7jXO7Wnf5HSBvh1aWX1JX4 HUxQUdCK2cndw1u9lYGSh+m1ZWuuLXGWWqn0d7sG//VPAk6a41zJDBm6YVW5Mnoc+pk2jP TnuCE+qhI87koqcY/sbP6aTwVfWn+rbqDaG1QzXm5RB5SnTZWJElDfHZ4CgGbOxNYH84K2 QqhsQ3/XVnd4LnW/Mw1CJBkBDwIJJIDkvsnThMoh6ApExzWiUt3BHn81pnElYNnCaL6ioD TIuC1ze05mCmNyLJjT6cXqKRFt6Yp26Hp1MRqHGZLTatJNJHy7Y9iBHRpgeNMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1767643765; 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=w+kDjQTWmNU3sBbBHHFZv/EHLD46/hjDmSqe9nqZWeY=; b=qj3Fov45Nik0KRq00Tfr5sM/l+jV4smMfln+BPV/PBqTcCCCEbUW27MFGsSF4WGfZLhVtB LSaytsimHVzGhS+wBtMnJZoyGk37xVdcVw65RdY6F64delG8Gm1aQ/YWvjkguEMKzAOlt8 PS7f/8c4MnaGZi3ULMFbXHS7+PASdWPPu7hr2Q3S5uW2lxB9YyNhOyOkyhyYVfmb7e64w4 +QfcHJr0EfSE9WbB6qjyY1QzF4joebJA4Pbn0PzmUG0f5WLA8eOq96bXDVZhbrxAy/9kOl vESscj0j4aMXYy+w9XwHr2r8o2Y0HMba6BNQ/Mi5fgOW9fBbcR9OmVvLLD9QJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1767643765; a=rsa-sha256; cv=none; b=JSjFmM8iAJSOVLOyFLwmV1BmMDC8Ji/5rgkz/Ixpl1dfKmB+sXZz2fUkCPTEUIo0qFsTC5 ITzmW5khgBLxpVA6SQu5xMrtAGnI6HcMJebtyscM9TGQPBT6ow7NBiUMbCSHJ/8YbaE4cn F5geajrSn5Pve7/EtUPuazSfMx8YtFWAUIg6oqRvPQLj/Tb7JSOSFgmjF7yNsJpZG7JusJ k4bhSnVLtBu57mKrZLvlHHSzkKMfENZQvrmd0PW20sfGzQuuOjEwoC5kvWgQ795Ouv8eRe wYgXfDlCcP+WAM1Y5IO3+oRmga3+X1NIHdVoiRkNXimxImGYgnRG4nbyLPCI/g== 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 4dlQPK2YnGzbSg for ; Mon, 05 Jan 2026 20:09:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3ff25 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 05 Jan 2026 20:09:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron Subject: git: 33fa585a0e90 - main - linuxkpi: Split 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: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 33fa585a0e9032b31c563c8aae001c0c2a4866d4 Auto-Submitted: auto-generated Date: Mon, 05 Jan 2026 20:09:25 +0000 Message-Id: <695c1a75.3ff25.63824e3f@gitrepo.freebsd.org> The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=33fa585a0e9032b31c563c8aae001c0c2a4866d4 commit 33fa585a0e9032b31c563c8aae001c0c2a4866d4 Author: Jean-Sébastien Pédron AuthorDate: 2025-08-17 11:10:43 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2026-01-05 19:32:48 +0000 linuxkpi: Split On Linux, they split the content into three headers: 1. 2. 3. The first includes the second, which includes the third. is also included on the compiler command line by default! I added that to the compilation flags of the DRM drivers. This allowed me to drop at least one: #ifdef __FreeBSD #include #endif Note that our copy of contains definitions which are not defined by Linux' . I left them alone. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54495 --- .../linuxkpi/common/include/linux/compiler.h | 48 +-------------------- .../common/include/linux/compiler_attributes.h | 49 ++++++++++++++++++++++ .../linuxkpi/common/include/linux/compiler_types.h | 45 ++++++++++++++++++++ 3 files changed, 96 insertions(+), 46 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/compiler.h b/sys/compat/linuxkpi/common/include/linux/compiler.h index 4146c829b936..90d907dd4d45 100644 --- a/sys/compat/linuxkpi/common/include/linux/compiler.h +++ b/sys/compat/linuxkpi/common/include/linux/compiler.h @@ -33,48 +33,18 @@ #include #include -#define __user -#define __kernel -#define __safe -#define __force -#define __nocast -#define __iomem -#define __chk_user_ptr(x) ((void)0) -#define __chk_io_ptr(x) ((void)0) -#define __builtin_warning(x, y...) (1) -#define __acquires(x) -#define __releases(x) -#define __acquire(x) do { } while (0) -#define __release(x) do { } while (0) -#define __cond_lock(x,c) (c) +#include + #define __bitwise #define __devinitdata -#ifndef __deprecated -#define __deprecated -#endif #define __init #define __initconst #define __devinit #define __devexit #define __exit -#define __rcu -#define __percpu -#define __weak __weak_symbol -#define __malloc -#define __attribute_const__ __attribute__((__const__)) -#undef __always_inline -#define __always_inline inline -#define noinline __noinline -#define noinline_for_stack __noinline #define ____cacheline_aligned __aligned(CACHE_LINE_SIZE) #define ____cacheline_aligned_in_smp __aligned(CACHE_LINE_SIZE) -#define fallthrough /* FALLTHROUGH */ do { } while(0) -#if __has_attribute(__nonstring__) -#define __nonstring __attribute__((__nonstring__)) -#else -#define __nonstring -#endif #if __has_attribute(__counted_by__) #define __counted_by(_x) __attribute__((__counted_by__(_x))) #else @@ -93,24 +63,12 @@ #define typeof(x) __typeof(x) #define uninitialized_var(x) x = x -#define __maybe_unused __unused -#define __always_unused __unused -#define __must_check __result_use_check - -#define __printf(a,b) __printflike(a,b) - -#define __diag_push() -#define __diag_pop() -#define __diag_ignore_all(...) #define barrier() __asm__ __volatile__("": : :"memory") #define lower_32_bits(n) ((u32)(n)) #define upper_32_bits(n) ((u32)(((n) >> 16) >> 16)) -#define ___PASTE(a,b) a##b -#define __PASTE(a,b) ___PASTE(a,b) - #define WRITE_ONCE(x,v) do { \ barrier(); \ (*(volatile __typeof(x) *)(uintptr_t)&(x)) = (v); \ @@ -129,8 +87,6 @@ #define lockless_dereference(p) READ_ONCE(p) #define _AT(T,X) ((T)(X)) - -#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) #define __must_be_array(a) __same_type(a, &(a)[0]) #define sizeof_field(_s, _m) sizeof(((_s *)0)->_m) diff --git a/sys/compat/linuxkpi/common/include/linux/compiler_attributes.h b/sys/compat/linuxkpi/common/include/linux/compiler_attributes.h new file mode 100644 index 000000000000..42908bb6c2b5 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/compiler_attributes.h @@ -0,0 +1,49 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. + * Copyright (c) 2015 François Tigeot + * All rights reserved. + */ + +#ifndef _LINUXKPI_LINUX_COMPILER_ATTRIBUTES_H_ +#define _LINUXKPI_LINUX_COMPILER_ATTRIBUTES_H_ + +#include + +#define __attribute_const__ __attribute__((__const__)) + +#ifndef __deprecated +#define __deprecated +#endif + +#define fallthrough /* FALLTHROUGH */ do { } while(0) + +#undef __always_inline +#define __always_inline inline + +#define __printf(a,b) __printflike(a,b) + +#define __malloc + +#define noinline __noinline + +#if __has_attribute(__nonstring__) +#define __nonstring __attribute__((__nonstring__)) +#else +#define __nonstring +#endif + +#define noinline_for_stack __noinline + +#define __maybe_unused __unused +#define __always_unused __unused + +#define __must_check __result_use_check + +#define __weak __weak_symbol + +#endif diff --git a/sys/compat/linuxkpi/common/include/linux/compiler_types.h b/sys/compat/linuxkpi/common/include/linux/compiler_types.h new file mode 100644 index 000000000000..7151c03de690 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/compiler_types.h @@ -0,0 +1,45 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. + * Copyright (c) 2015 François Tigeot + * All rights reserved. + */ + +#ifndef _LINUXKPI_LINUX_COMPILER_TYPES_H_ +#define _LINUXKPI_LINUX_COMPILER_TYPES_H_ + +#include + +#include + +#define __kernel +#define __user +#define __iomem +#define __percpu +#define __rcu +#define __chk_user_ptr(x) ((void)0) +#define __chk_io_ptr(x) ((void)0) +#define __acquires(x) +#define __releases(x) +#define __acquire(x) do { } while (0) +#define __release(x) do { } while (0) +#define __cond_lock(x,c) (c) +#define __force +#define __nocast +#define __safe +#define __builtin_warning(x, y...) (1) + +#define ___PASTE(a,b) a##b +#define __PASTE(a,b) ___PASTE(a,b) + +#define __diag_push() +#define __diag_pop() +#define __diag_ignore_all(...) + +#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) + +#endif