__pci_size_bars(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– __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 up
  • count β€” how many BARs you wanna size
  • pos β€” the starting config space position (where in config space we start looking, iykyk)
  • sizes β€” the array where the mask values get stashed
  • rom β€” 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 🌈

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