<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/compat/linuxkpi/common/include/linux/kfifo.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: Fix an off-by-one error in the kfifo implementation</title>
<updated>2026-04-15T13:33:04+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2026-04-15T13:33:04+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=52d2fc702b85d56b35f8828fe7efca3cde0d25b7'/>
<id>52d2fc702b85d56b35f8828fe7efca3cde0d25b7</id>
<content type='text'>
"total" is the number of slots in the array, so wraparound needs to be
done when "first" or "last" is greater than or equal to the number of
slots.

Note that no consumers of the code are currently connected to the kernel
build.

Reported by:	Stanislav Fort &lt;stanislav.fort@aisle.com&gt;
Reviewed by:	bz, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56371
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
"total" is the number of slots in the array, so wraparound needs to be
done when "first" or "last" is greater than or equal to the number of
slots.

Note that no consumers of the code are currently connected to the kernel
build.

Reported by:	Stanislav Fort &lt;stanislav.fort@aisle.com&gt;
Reviewed by:	bz, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56371
</pre>
</div>
</content>
</entry>
<entry>
<title>linuxkpi: Add support for statically-allocated kfifo</title>
<updated>2026-01-05T19:32:49+00:00</updated>
<author>
<name>Jean-Sébastien Pédron</name>
<email>dumbbell@FreeBSD.org</email>
</author>
<published>2025-09-07T08:37:27+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=55bd09ae0fc437c9eb135952ac278540b7388add'/>
<id>55bd09ae0fc437c9eb135952ac278540b7388add</id>
<content type='text'>
The main difference with the dynamically allocated version is that the
structure is initialized with `DECLARE_KFIFO()` which takes the number
of items as an additional argument compared to `DECLARE_KFIFO_PTR()`.

The declared structure is then initialized with `INIT_KFIFO()` which
sets all fields to 0, except `total` which is computed from the size of
the array passed to `DECLARE_KFIFO()`.

The amdgpu DRM driver started to used this in Linux 6.10.

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54497
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The main difference with the dynamically allocated version is that the
structure is initialized with `DECLARE_KFIFO()` which takes the number
of items as an additional argument compared to `DECLARE_KFIFO_PTR()`.

The declared structure is then initialized with `INIT_KFIFO()` which
sets all fields to 0, except `total` which is computed from the size of
the array passed to `DECLARE_KFIFO()`.

The amdgpu DRM driver started to used this in Linux 6.10.

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54497
</pre>
</div>
</content>
</entry>
<entry>
<title>LinuxKPI: extend kfifo to be usable</title>
<updated>2022-08-18T20:26:20+00:00</updated>
<author>
<name>Bjoern A. Zeeb</name>
<email>bz@FreeBSD.org</email>
</author>
<published>2022-07-16T00:36:55+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4a7e8c7bd40bc39b3e247df069fa913f0197ea01'/>
<id>4a7e8c7bd40bc39b3e247df069fa913f0197ea01</id>
<content type='text'>
Implement some basic kfifo pieces as needed by drivers.

MFC after:	2 weeks
Reviewed by:	wulf, hselasky
Differential Revision: https://reviews.freebsd.org/D35829
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implement some basic kfifo pieces as needed by drivers.

MFC after:	2 weeks
Reviewed by:	wulf, hselasky
Differential Revision: https://reviews.freebsd.org/D35829
</pre>
</div>
</content>
</entry>
<entry>
<title>linuxkpi: Add kfifo.h</title>
<updated>2022-06-29T07:54:53+00:00</updated>
<author>
<name>Emmanuel Vadot</name>
<email>manu@FreeBSD.org</email>
</author>
<published>2022-06-23T07:50:29+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=088b746cbda664602f9cee0d1415ae8d98389f38'/>
<id>088b746cbda664602f9cee0d1415ae8d98389f38</id>
<content type='text'>
Provide macros needed for drm-kmod.

Reviewed by:	bz
MFC after:      1 week
Sponsored by:	Beckhoff Automation GmbH &amp; Co. KG
Differential Revision:	https://reviews.freebsd.org/D35563
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Provide macros needed for drm-kmod.

Reviewed by:	bz
MFC after:      1 week
Sponsored by:	Beckhoff Automation GmbH &amp; Co. KG
Differential Revision:	https://reviews.freebsd.org/D35563
</pre>
</div>
</content>
</entry>
</feed>
