sba_alloc_range(9)
β¨ sba_alloc_range(9) β¨
ok so bestie, welcome to the Kernel API Manual β this one's sba_alloc_range(9) and it's genuinely such a mood π
πΈ NAME πΈ
sba_alloc_range β find free bits and mark them in the IO PDIR resource bitmap π
like, it literally goes shopping for empty bits and then claims them. iconic behaviour tbh.
π¦ SYNOPSIS π¦
int sba_alloc_range (struct ioc *ioc , struct device *dev , size_t size );
that's the whole vibe. three args, returns an int. no cap.
π ARGUMENTS π
iocβ the IO MMU structure that owns the pdir we're interested in π like, this is the main character, the one holding the resource bitmap we're about to rummage through.devβ the device for which pages should be alloced π«Ά this is who the pages are for, bestie. we're doing this for them.sizeβ number of bytes to create a mapping for π so like, how big a chunk are we talking. that's the ask.
π₯ DESCRIPTION π₯
okay so here's the whole plot: given a size, it finds consecutive unmarked bits β like a little row of empty seats all next to each other, fr fr β and then marks those bits in the resource bit map π―
that's it. that's the function. find the gap, claim the gap. periodt. π
π SEE ALSO π
lowkey there's a whole friend group here, iykyk:
Kernel file ./drivers/parisc/sba_iommu.c plus the entire squad:
sba_dump_ranges(9)sba_dump_tlb(9)sba_dump_pdir_entry(9)sba_check_pdir(9)sba_dump_sg(9)sba_search_bitmap(9)sba_free_range(9)sba_io_pdir_entry(9)sba_mark_invalid(9)sba_dma_supported(9)sba_map_single(9)sba_unmap_phys(9)sba_alloc(9)sba_free(9)sba_map_sg(9)sba_unmap_sg(9)sba_get_iommu(9)sba_directed_lmmio(9)sba_distributed_lmmio(9)
ok bye bestie, go read those too π§π
β π this page came from ./drivers/parisc, dated October 2026, and it's filed under sba_alloc_range(9). 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