pci_get_rom_size(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– pci_get_rom_size(9) πŸ’–

okay so bestie, we're in the Kernel API Manual today and the star of the show is pci_get_rom_size β€” the little function that tells you how big a ROM image actually is πŸ‘‘ no cap.


✨ NAME ✨

pci_get_rom_size β€” obtain the actual size of the ROM image πŸŽ€


✨ SYNOPSIS ✨

size_t pci_get_rom_size (struct pci_dev *pdev , void __iomem *rom ,
       size_t size );

literally right there, copy it exactly, don't be weird about the spacing 🫢


✨ ARGUMENTS ✨

  • pdev β€” target PCI device. the one we're snooping on πŸ’…
  • rom β€” kernel virtual pointer to image of ROM. yes, a kernel virtual pointer, stay in your lane πŸ”₯
  • size β€” size of PCI window. the big floppy outer box, not the actual picture inside, iykyk 😭

✨ RETURN ✨

size of actual ROM image ⭐ that's the whole point, that's the payoff, that's the main character moment.


✨ DESCRIPTION ✨

so the vibe is: determine the actual length of the ROM image 🌸 because here's the tea β€” the PCI window size could be much larger than the actual image size πŸ’€ like, dramatically larger. the window is giving oversized hoodie and the image inside is giving tiny little guy. this function does the vibe check and hands you the real number ✨

lowkey important: size is the window, the return value is the image. do not get these two confused or it's over for you πŸ™ˆ

✨ SEE ALSO ✨

go read the whole squad fr fr, they're all in ./drivers/pci/rom.c and they ate πŸ“


and that's the page bestie!! brought to you by ./drivers/pci in October 2026, fresh out of the Kernel API Manual πŸ’œ mwah, go size some ROMs responsibly πŸ§šπŸ’–

πŸ“¦ where this page comes from