<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/compat/linuxkpi/common/include/linux/kernel.h, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>linuxkpi: Move `ARRAY_SIZE` to &lt;linux/array_size.h&gt;</title>
<updated>2026-04-22T20:46:57+00:00</updated>
<author>
<name>Jean-Sébastien Pédron</name>
<email>dumbbell@FreeBSD.org</email>
</author>
<published>2026-04-20T21:34:08+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=1c641d0436e377c57a767e37f56ce65253817d67'/>
<id>1c641d0436e377c57a767e37f56ce65253817d67</id>
<content type='text'>
The DRM generic code started to import this header directly in Linux
6.12.x. Let's move the definition of `ARRAY_SIZE()` (the only thing that
&lt;linux/array_size.h&gt; defines) to this header.

Also, include &lt;linux/array_size.h&gt; from the same headers as Linux. This
includes &lt;linux/kernel.h&gt;, so the change should not break anything.

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56570
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The DRM generic code started to import this header directly in Linux
6.12.x. Let's move the definition of `ARRAY_SIZE()` (the only thing that
&lt;linux/array_size.h&gt; defines) to this header.

Also, include &lt;linux/array_size.h&gt; from the same headers as Linux. This
includes &lt;linux/kernel.h&gt;, so the change should not break anything.

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56570
</pre>
</div>
</content>
</entry>
<entry>
<title>linuxkpi: Move {lower,upper}_32_bits macros to &lt;linux/wordpart.h&gt;</title>
<updated>2026-04-22T20:46:52+00:00</updated>
<author>
<name>Jean-Sébastien Pédron</name>
<email>dumbbell@FreeBSD.org</email>
</author>
<published>2026-04-11T15:21:53+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=0a2f3b8ef16786a44fc88afd8862920df4527a3c'/>
<id>0a2f3b8ef16786a44fc88afd8862920df4527a3c</id>
<content type='text'>
... from &lt;linux/compiler.h&gt;.

&lt;linux/wordpart.h&gt; is the header defining them on Linux 6.12 (I didn't
check older versions).

&lt;linux/wordpart.h&gt; is also included from &lt;linux/kernel.h&gt;.

The DRM generic code started to depend on &lt;linux/wordpart.h&gt; in Linux
6.12.

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56441
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
... from &lt;linux/compiler.h&gt;.

&lt;linux/wordpart.h&gt; is the header defining them on Linux 6.12 (I didn't
check older versions).

&lt;linux/wordpart.h&gt; is also included from &lt;linux/kernel.h&gt;.

The DRM generic code started to depend on &lt;linux/wordpart.h&gt; in Linux
6.12.

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56441
</pre>
</div>
</content>
</entry>
<entry>
<title>linuxkpi: Define `system_state`</title>
<updated>2026-04-22T18:09:55+00:00</updated>
<author>
<name>Jean-Sébastien Pédron</name>
<email>dumbbell@FreeBSD.org</email>
</author>
<published>2026-04-21T00:14:41+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=305ebed50b4e2e2346d211c5a65320fa45c7fbc4'/>
<id>305ebed50b4e2e2346d211c5a65320fa45c7fbc4</id>
<content type='text'>
This is a global variable used to track the state of the system, like
booting, running, halting and so on.

This variable is based on the `enum system_states` enumeration.

For now, always set `system_state` to `SYSTEM_RUNNING`.

The amdgpu DRM driver started to use this in Linux 6.12.x.

Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56575
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a global variable used to track the state of the system, like
booting, running, halting and so on.

This variable is based on the `enum system_states` enumeration.

For now, always set `system_state` to `SYSTEM_RUNNING`.

The amdgpu DRM driver started to use this in Linux 6.12.x.

Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56575
</pre>
</div>
</content>
</entry>
<entry>
<title>linuxkpi: Define diagnostic macros like `might_resched()` or `cant_sleep()`</title>
<updated>2026-04-21T22:18:24+00:00</updated>
<author>
<name>Jean-Sébastien Pédron</name>
<email>dumbbell@FreeBSD.org</email>
</author>
<published>2026-04-11T09:37:05+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ad528a6b174e7090cb06062867e9a146b017205d'/>
<id>ad528a6b174e7090cb06062867e9a146b017205d</id>
<content type='text'>
They are no-ops on FreeBSD.

While here, move the already defined `might_sleep*()` macros from
&lt;linux/wait.h&gt; to &lt;linux/kernel.h&gt; where they belong.

The DRM generic code started to use `might_fault()` in Linux 6.12.

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56434
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
They are no-ops on FreeBSD.

While here, move the already defined `might_sleep*()` macros from
&lt;linux/wait.h&gt; to &lt;linux/kernel.h&gt; where they belong.

The DRM generic code started to use `might_fault()` in Linux 6.12.

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56434
</pre>
</div>
</content>
</entry>
<entry>
<title>LinuxKPI: move hex2bin() from kernel.h to new hex.h</title>
<updated>2026-04-18T01:12:12+00:00</updated>
<author>
<name>Bjoern A. Zeeb</name>
<email>bz@FreeBSD.org</email>
</author>
<published>2026-04-14T13:36:40+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=98297ff3cfbb42df86fa7af51a2740d5aa7236eb'/>
<id>98297ff3cfbb42df86fa7af51a2740d5aa7236eb</id>
<content type='text'>
New Linux v7.0 drivers include hex.h.  Rather than adding a dummy
header, migrate the kernel.h hex2bin() into hex.h, where it belongs.
Care needs to be taken as the _h2b() helper function is still used by
other bits in kernel.h.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	emaste, dumbbell
Differential Revision: https://reviews.freebsd.org/D56391
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
New Linux v7.0 drivers include hex.h.  Rather than adding a dummy
header, migrate the kernel.h hex2bin() into hex.h, where it belongs.
Care needs to be taken as the _h2b() helper function is still used by
other bits in kernel.h.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	emaste, dumbbell
Differential Revision: https://reviews.freebsd.org/D56391
</pre>
</div>
</content>
</entry>
<entry>
<title>linuxkpi: Move `_RET_IP_` to &lt;linux/instruction_pointer.h&gt;</title>
<updated>2026-04-06T19:28:08+00:00</updated>
<author>
<name>Jean-Sébastien Pédron</name>
<email>dumbbell@FreeBSD.org</email>
</author>
<published>2026-03-02T23:06:54+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=8af854ea479a140a6e284d74e481d0b547408df2'/>
<id>8af854ea479a140a6e284d74e481d0b547408df2</id>
<content type='text'>
This matches the declaration on Linux.

Reviewed by:	bz, emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55730
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This matches the declaration on Linux.

Reviewed by:	bz, emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55730
</pre>
</div>
</content>
</entry>
<entry>
<title>LinuxKPI: Remove stray semicolons</title>
<updated>2024-10-24T15:04:48+00:00</updated>
<author>
<name>Zhenlei Huang</name>
<email>zlei@FreeBSD.org</email>
</author>
<published>2024-10-24T15:04:48+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b4856b8e9d872ca6ee0c4ef43e7047693ef7645b'/>
<id>b4856b8e9d872ca6ee0c4ef43e7047693ef7645b</id>
<content type='text'>
MFC after:	1 week
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MFC after:	1 week
</pre>
</div>
</content>
</entry>
<entry>
<title>LinuxKPI: Remove linux/sched.h include from linux/kernel.h header</title>
<updated>2024-06-26T20:47:12+00:00</updated>
<author>
<name>Vladimir Kondratyev</name>
<email>wulf@FreeBSD.org</email>
</author>
<published>2024-06-26T20:47:12+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=256eb8d5361143b7d436a195530e0eefe1450e6d'/>
<id>256eb8d5361143b7d436a195530e0eefe1450e6d</id>
<content type='text'>
This include prevents usage of any kernel.h helpers in sched.h and
all of dependencies. Linux does not have it too.
Fix building of kernel and drm-kmod after than.

Sponsored by:	Serenity CyberSecurity, LLC
MFC after:	1 week
Reviewed by:	manu, bz
Differential Revision:	https://reviews.freebsd.org/D45692
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This include prevents usage of any kernel.h helpers in sched.h and
all of dependencies. Linux does not have it too.
Fix building of kernel and drm-kmod after than.

Sponsored by:	Serenity CyberSecurity, LLC
MFC after:	1 week
Reviewed by:	manu, bz
Differential Revision:	https://reviews.freebsd.org/D45692
</pre>
</div>
</content>
</entry>
<entry>
<title>LinuxKPI: Move kstrto* functions to linux/kstrtox.h</title>
<updated>2024-06-06T20:42:07+00:00</updated>
<author>
<name>Vladimir Kondratyev</name>
<email>wulf@FreeBSD.org</email>
</author>
<published>2024-06-06T20:42:07+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=a97f3a9ec96a2de542326a158d1ab8e65ad4fe5f'/>
<id>a97f3a9ec96a2de542326a158d1ab8e65ad4fe5f</id>
<content type='text'>
from linux/kernel.h to match Linux and
allow direct linux/kstrtox.h inclusion.

Sponsored by:	Serenity Cyber Security, LLC
MFC after:	1 week
Reviewed by:	bz
Differential Revision:	https://reviews.freebsd.org/D45454
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
from linux/kernel.h to match Linux and
allow direct linux/kstrtox.h inclusion.

Sponsored by:	Serenity Cyber Security, LLC
MFC after:	1 week
Reviewed by:	bz
Differential Revision:	https://reviews.freebsd.org/D45454
</pre>
</div>
</content>
</entry>
<entry>
<title>LinuxKPI: Move linux/math.h content out of linux/kernel.h</title>
<updated>2024-06-06T20:42:07+00:00</updated>
<author>
<name>Vladimir Kondratyev</name>
<email>wulf@FreeBSD.org</email>
</author>
<published>2024-06-06T20:42:07+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=588064e658d32f037854dd852b988728197a28de'/>
<id>588064e658d32f037854dd852b988728197a28de</id>
<content type='text'>
To match Linux and allow direct linux/math.h inclusion.

Sponsored by:	Serenity Cyber Security, LLC
MFC after:	1 week
Reviewed by:	bz
Differential Revision:	https://reviews.freebsd.org/D45452
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To match Linux and allow direct linux/math.h inclusion.

Sponsored by:	Serenity Cyber Security, LLC
MFC after:	1 week
Reviewed by:	bz
Differential Revision:	https://reviews.freebsd.org/D45452
</pre>
</div>
</content>
</entry>
</feed>
