HomeFreeBSD

linuxkpi: Add support for statically-allocated kfifo

Description

linuxkpi: Add support for statically-allocated kfifo

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

Details

Provenance
dumbbellAuthored on Sep 7 2025, 8:37 AM
Reviewer
bz
Differential Revision
D54497: linuxkpi: Add support for statically-allocated kfifo
Parents
rGb5f7a0b0fd89: linuxkpi: Replicate Linux #includes between headers
Branches
Unknown
Tags
Unknown