<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/compat/linuxkpi/common/include/linux/compiler_attributes.h, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>linuxkpi: Split &lt;linux/compiler.h&gt;</title>
<updated>2026-01-05T19:32:48+00:00</updated>
<author>
<name>Jean-Sébastien Pédron</name>
<email>dumbbell@FreeBSD.org</email>
</author>
<published>2025-08-17T11:10:43+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=33fa585a0e9032b31c563c8aae001c0c2a4866d4'/>
<id>33fa585a0e9032b31c563c8aae001c0c2a4866d4</id>
<content type='text'>
On Linux, they split the content into three headers:
1. &lt;linux/compiler.h&gt;
2. &lt;linux/compiler_types.h&gt;
3. &lt;linux/compiler_attributes.h&gt;

The first includes the second, which includes the third.

&lt;linux/compiler_types.h&gt; 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 &lt;linux/compiler.h&gt;
    #endif

Note that our copy of &lt;linux/compiler.h&gt; contains definitions which are
not defined by Linux' &lt;linux/compiler.h&gt;. I left them alone.

Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54495
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On Linux, they split the content into three headers:
1. &lt;linux/compiler.h&gt;
2. &lt;linux/compiler_types.h&gt;
3. &lt;linux/compiler_attributes.h&gt;

The first includes the second, which includes the third.

&lt;linux/compiler_types.h&gt; 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 &lt;linux/compiler.h&gt;
    #endif

Note that our copy of &lt;linux/compiler.h&gt; contains definitions which are
not defined by Linux' &lt;linux/compiler.h&gt;. I left them alone.

Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54495
</pre>
</div>
</content>
</entry>
</feed>
