pci_get_rom_size(9)
π 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 β¨
- Kernel file
./drivers/pci/rom.c pci_enable_rom(9)pci_disable_rom(9)pci_map_rom(9)pci_unmap_rom(9)
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
- 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