pci_epf_assign_bar_space(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pci_epf_assign_bar_space β€” the Kernel API Manual, bestie edition πŸ’…

okay so you found the pci_epf_assign_bar_space(9) page, congrats, this is the "give my endpoint function its BAR memory" moment and honestly it's kind of iconic. it lives in the Kernel API Manual, which is lowkey the most serious group chat in the whole kernel.


✨ NAME ✨

pci_epf_assign_bar_space β€” Assign PCI EPF BAR space πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

int pci_epf_assign_bar_space (struct pci_epf *epf , size_t size , enum
pci_barno bar , const struct pci_epc_features *epc_features , enum
pci_epc_interface_type type , dma_addr_t bar_addr );

🌸 ARGUMENTS 🌸

  • epf β€” the EPF device that's getting the BAR memory assigned. this is the main character of the call 🫢
  • size β€” how big the memory chunk you're assigning actually is.
  • bar β€” which BAR number this memory is being assigned for. pick your fave.
  • epc_features β€” the features the EPC provides, specific to this EPF. iykyk.
  • type β€” tells you whether the assignment is for the primary EPC or the secondary EPC. two vibes, one argument ✨
  • bar_addr β€” the address to be assigned for the bar.

πŸ’– DESCRIPTION πŸ’–

so like, you invoke this when you need to assign memory for the PCI EPF BAR β€” that's the whole job, no cap.

and here's the cute automatic part: the flag PCI_BASE_ADDRESS_MEM_TYPE_64 will automatically get set if the BAR can only be a 64-bit BAR, or if the requested size is larger than 2 GB. not you doing it manually, the function handles it. slay. πŸ”₯


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/pci/endpoint/pci-epf-core.c, plus the whole friend group:


ngl go read those too, they're literally the rest of the lore 🧚

okay that's the whole page!! this one's brought to you by ./drivers/pci/endpoint (the source, she lives there πŸ’…) and the date stamp says October 2026 β€” mark your calendars bestie, that's the version you're reading. bye, ily, go assign some BAR space πŸ’œπŸŒΈβœ¨

πŸ“¦ where this page comes from