__pci_size_bars(9)
π __pci_size_bars β a Kernel API Manual moment π
okay so bestie, welcome to the __pci_size_bars (9) page β she's a kernel API girlie and she's here to read raw BAR masks for a whole range of PCI BARs at once. yes, a range. not one at a time. we love efficiency in this house β¨
πΈ NAME πΈ
__pci_size_bars β read the raw BAR mask for a range of PCI BARs π
π¦ SYNOPSIS π¦
void __pci_size_bars (struct pci_dev *dev , int count , unsigned int pos
, u32 *sizes , bool rom );
literally that's the whole signature, no cap, copy it exactly bestie π
β¨ ARGUMENTS β¨
devβ the PCI device π«Ά like, the actual one you're sizing upcountβ how many BARs you wanna sizeposβ the starting config space position (where in config space we start looking, iykyk)sizesβ the array where the mask values get stashedromβ says whether to use the ROM mask, which is the move because it avoids enabling ROM BARs π
π DESCRIPTION π
so the sizes array you pass in has to be big enough to hold results for count u32 BARs β that's a you problem, not hers π. and the caller is the one responsible for disabling decode to the specified BAR range around calling this function. yes, around calling it. that's the whole vibe.
the way that this function is iconic is that it's designed to avoid disabling decode around sizing each BAR individually β because doing it one by one can result in non-trivial overhead in virtualized environments with very large PCI BARs ππ like, genuinely expensive. so she batches it. main character energy fr fr.
β οΈ small but important: the array sizing and the decode-disabling are both on you, the caller. she's not doing your homework π
π SEE ALSO π
- Kernel file
./drivers/pci/probe.c __pci_read_base(9)pcie_get_link_speed(9)pci_ea_fixed_busnrs(9)pci_ext_cfg_is_aliased(9)pci_cfg_space_size_ext(9)pci_intx_mask_broken(9)pci_setup_device(9)pcie_relaxed_ordering_enabled(9)pci_release_dev(9)pci_scan_slot(9)pci_scan_child_bus_extend(9)pci_scan_child_bus(9)pcibios_root_bridge_prepare(9)pci_rescan_bus_bridge_resize(9)pci_rescan_bus(9)
that's the whole friend group, go say hi π¦π
and that's the page!! mwah π this lil gem lives in ./drivers/pci and she was dated October 2026 β same name up top and down bottom, __pci_size_bars(9), periodt πβ¨
π¦ 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