pci_p2pmem_alloc_sgl(9)
π pci_p2pmem_alloc_sgl(9) π
okay bestie, welcome to the Kernel API Manual β this one's literally pci_p2pmem_alloc_sgl, and it's giving "let me grab you some peer-to-peer DMA memory, in a scatterlist, no big deal" β¨
πΈ NAME πΈ
pci_p2pmem_alloc_sgl β allocate peer-to-peer DMA memory in a scatterlist π§
β¨ SYNOPSIS β¨
struct scatterlist * pci_p2pmem_alloc_sgl (struct pci_dev *pdev ,
unsigned int *nents , u32 length );
like, that's the whole signature, copy it exactly bestie, don't freestyle π
π ARGUMENTS π
pdevβ the device you're allocating memory from π«Ά (yes, from. it's its whole thing.)nentsβ the number of SG entries in the list, i.e. how many little scatterlist slices we're working with βlengthβ number of bytes to allocate, the actual size ask π
π₯ RETURN π₯
NULL on error π β or, when it slays, a struct scatterlist pointer and nents on success π
bestie please check the return value, NULL is real and it will absolutely humble you π
π¦ SEE ALSO π¦
Kernel file ./drivers/pci/p2pdma.c and honestly the whole p2pdma friend group:
pcim_p2pdma_init(9)pcim_p2pdma_provider(9)pci_p2pdma_add_resource(9)pci_p2pdma_distance_many(9)pci_has_p2pmem(9)pci_p2pmem_find_many(9)pci_alloc_p2pmem(9)pci_free_p2pmem(9)pci_p2pmem_virt_to_bus(9)pci_p2pmem_free_sgl(9)pci_p2pmem_publish(9)pci_p2pdma_map_type(9)pci_p2pdma_enable_store(9)pci_p2pdma_enable_show(9)
and that's the vibe check, periodt π
this cutie lives in ./drivers/pci, dated October 2026, and it answers to the name pci_p2pmem_alloc_sgl(9) πβ¨ go forth and allocate responsibly bestie π¦π
π¦ 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