pbus_size_mem(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pbus_size_mem β€” the kernel API manual, bestie edition ✨

Okay so you're looking at pbus_size_mem(9) (that's the manual page name, yes it's giving very "section 9 energy" πŸŽ€), and honestly? It's a sleeper hit. Let's get into it.


🌸 NAME 🌸

pbus_size_mem β€” size the memory window of a given bus πŸ¦‹

Like, it literally just figures out how big a bus's memory window needs to be. Iconic behavior, no notes.


✨ SYNOPSIS ✨

void pbus_size_mem (struct pci_bus *bus , struct resource *b_res ,
resource_size_t add_size , struct list_head *realloc_head );

That's the whole signature, character for character, don't come for me πŸ’…


🫢 ARGUMENTS 🫢

  • bus β€” the bus. That's it, that's the whole vibe. It's the bus. 🚌
  • b_res β€” the bridge window resource πŸŒ‰ (the actual thing being sized, main character honestly)
  • add_size β€” additional memory window, like extra on top of what's already there
  • realloc_head β€” track the additional memory window on this list πŸ“‹ (yes it's a struct list_head *, yes it keeps receipts)

πŸ’– DESCRIPTION πŸ’–

So here's what it actually does, and lowkey it's doing a lot:

  • It calculates the size of the bridge window b_res and the minimal alignment that guarantees all child resources fit in that size. The way it just… makes everything fit πŸ˜­πŸ‘‘
  • It sets the bus resource start/end to indicate the required size β€” but only if there's an available unassigned bus resource of the desired type. Conditional queen πŸ’…
  • It adds optional resource requests to the realloc_head list, if that list is supplied. If you didn't pass one? It simply doesn't. Respect. 🧚
fr fr, that's the whole description β€” every clause kept, nothing invented, we don't do fanfic here πŸ™ˆ

🌈 SEE ALSO 🌈

Peep the kernel file ./drivers/pci/setup-bus.c β€” that's where the magic lives, bestie πŸ”₯

And the whole friend group of related functions, all of them, in order:

That's the pbus_size_io(9) sibling β€” the I/O counterpart, we love a matching set πŸŽ€


And that's the page!! πŸ’œ This lil cutie lives in ./drivers/pci, and the version of this manual you're reading is dated October 2026 β€” so go forth, size those memory windows, and slay πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from