kfifo_dma_ou...epare_mapped(9)
π kfifo_dma_out_prepare_mapped(9) π
okay so bestie, this is a page straight out of the Kernel API Manual (yes, the kernel has a manual, she's iconic) and it's all about kfifo_dma_out_prepare_mapped β the little macro that sets you up for DMA output. pull up a chair, we're getting into it π
β¨ NAME β¨
kfifo_dma_out_prepare_mapped β setup a scatterlist for DMA output π¦
πΈ SYNOPSIS πΈ
kfifo_dma_out_prepare_mapped (fifo , sgl , nents , len , dma );
π ARGUMENTS π
fifoβ the address of the fifo to be used, like, the actual fifo you're working with π«Άsglβ a pointer to the scatterlist array. that's your scatterlist, bestie, point at itnentsβ the number of entries in the scatterlist array. count 'em, no caplenβ the number of elements to transferdmaβ the mapped dma address to fill intosglβ
π₯ DESCRIPTION π₯
so this macro fills a scatterlist for DMA output, and it'll do at most len bytes to transfer. literally that's the job π
it returns the number of entries in the scatterlist array β and heads up, a zero means there is no space available and the scatterlist is not filled. so if you get a zero, don't go thinking you've got data in there, because you do not π
ngl the vibe here is immaculate: with only one concurrent reader and one concurrent writer, you don't need extra locking to use these macros. one reader, one writer, no drama, no locks π₯
π§ SEE ALSO π§
kernel file ./include/linux/kfifo.h β and honestly the whole kfifo fam showed up for this one, we love a supportive ensemble π
DECLARE_KFIFO_PTR(9)DECLARE_KFIFO(9)INIT_KFIFO(9)DEFINE_KFIFO(9)kfifo_initialized(9)kfifo_esize(9)kfifo_recsize(9)kfifo_size(9)kfifo_reset(9)kfifo_reset_out(9)kfifo_len(9)kfifo_is_empty(9)kfifo_is_empty_spinlocked(9)kfifo_is_empty_spinlocked_noirqsave(9)kfifo_is_full(9)kfifo_avail(9)kfifo_skip_count(9)kfifo_skip(9)kfifo_peek_len(9)kfifo_alloc(9)kfifo_alloc_node(9)kfifo_free(9)kfifo_init(9)kfifo_put(9)kfifo_get(9)kfifo_peek(9)kfifo_in(9)kfifo_in_spinlocked(9)kfifo_in_spinlocked_noirqsave(9)kfifo_out(9)kfifo_out_spinlocked(9)kfifo_out_spinlocked_noirqsave(9)kfifo_from_user(9)kfifo_to_user(9)kfifo_dma_in_prepare_mapped(9)kfifo_dma_in_finish(9)kfifo_dma_out_finish(9)kfifo_out_peek(9)kfifo_out_linear(9)kfifo_out_linear_ptr(9)
and that's the whole page, periodt π this lil gem lives in ./include/linux and it's dated October 2026 β so yeah, future energy fr fr. go forth and fill those scatterlists, bestie, you're gonna slay πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms