swiotlb_alloc_tlb(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… swiotlb_alloc_tlb(9) β€” like, the Kernel API Manual, bestie ✨

okay so this is a page from the Kernel API Manual, and it's about swiotlb_alloc_tlb β€” yes that's the name, yes I said it out loud, no I will not say it again 🫢


✨ NAME ✨

swiotlb_alloc_tlb β€” allocate a dynamic IO TLB buffer πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

struct page * swiotlb_alloc_tlb (struct device *dev , struct io_tlb_mem
*mem , size_t bytes , u64 phys_limit , gfp_t gfp , void **vaddr );

literally the whole signature, copied exact, no cap πŸ’…


🌸 ARGUMENTS 🌸

  • dev β€” the Device that we're allocating a memory pool for. it's giving "who is this for" energy πŸ‘‘
  • mem β€” the SWIOTLB allocator for the pool. the main character of the allocator world fr ✨
  • bytes β€” size of the buffer. how big, bestie πŸ“
  • phys_limit β€” maximum allowed physical address of the buffer. a hard ceiling, no vibes above this line 🚫
  • gfp β€” the GFP flags for the allocation. it's giving "how should we do this" 😌
  • vaddr β€” receives the virtual address for the allocated buffer. it's an out-param, so it gets filled in, she doesn't give, she receives πŸ’–

⭐ RETURN ⭐

Allocated pages, or NULL on allocation failure. so like… either you get pages or you get nothing and you have to deal with it 😭 check for NULL, please, I'm begging πŸ™ˆ


🌈 SEE ALSO 🌈

Kernel file ./kernel/dma/swiotlb.c, plus the whole friend group β€” every single one of them, and yes I'm listing all of them because they all matter, periodt:

struct io_tlb_slot(9), struct io_tlb_area(9), swiotlb_adjust_nareas(9), limit_nareas(9), add_mem_pool(9), alloc_dma_pages(9), swiotlb_free_tlb(9), swiotlb_alloc_pool(9), swiotlb_dyn_alloc(9), __swiotlb_find_pool(9), swiotlb_del_pool(9), swiotlb_dev_init(9), swiotlb_align_offset(9), swiotlb_search_pool_area(9), swiotlb_search_area(9), swiotlb_find_slots(9), mem_pool_used(9), mem_used(9), swiotlb_tbl_map_single(9), swiotlb_del_transient(9), is_swiotlb_allocated(9), default_swiotlb_base(9), default_swiotlb_limit(9)

like, that's the whole group chat right there πŸ«ΆπŸ’€


kay bye, this page lives in ./kernel/dma and it's dated October 2026 β€” so yeah, future girl summer, slay πŸ§šβ€β™€οΈπŸ’œ

πŸ“¦ where this page comes from