sba_search_bitmap(9)
β¨ sba_search_bitmap β it's giving "find me some free space" β¨
okay so bestie, welcome to the sba_search_bitmap(9) page π
this is a Kernel API Manual entry and honestly? it's lowkey iconic. it lives in the kernel sources and it's here to help you snatch some consecutive free bits out of an IO PDIR resource bitmap. no cap. let's get into it π«Ά
πΈ SYNOPSIS πΈ
unsigned long sba_search_bitmap (struct ioc *ioc , struct device *dev ,
unsigned long bits_wanted );
like, that's the whole thing. three args, one unsigned long coming back at you β¨
π ARGUMENTS π
iocβ the IO MMU structure that owns the pdir we care about. it's the main character here, the one holding the goods πdevβ the device we're querying the bitmap for. gotta know who's asking, periodt πββοΈbits_wantedβ literal number of entries we need. how many bits are we shopping for, bestie ποΈ
π DESCRIPTION π
so what does it actually do? it finds consecutive free bits in the resource bitmap β and each bit represents one entry in the IO Pdir. that's the whole vibe check β¨
and here's the fun part, the original literally calls it out: Cool perf optimization: search for log2(size) bits at a time. π₯ she's efficient, she's smart, she ate that fr fr π
π¦ SEE ALSO π¦
bestie these are all the siblings, the whole friend group ππ β and they all hang out in the kernel file ./drivers/parisc/sba_iommu.c:
sba_dump_ranges(9)sba_dump_tlb(9)sba_dump_pdir_entry(9)sba_check_pdir(9)sba_dump_sg(9)sba_alloc_range(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)
go read them too, iykyk ππΈ
ngl if you're poking around in ./drivers/parisc you're already kind of a legend π§π
and that's the page!! tysm for reading, slay π β¨
sign-off time π β this one's from the ./drivers/parisc corner of the kernel, dated October 2026, and it's the sba_search_bitmap(9) manual page living its best life. mwah π
π¦ 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