pci_epf_assign_bar_space(9)
π 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:
pci_epf_unbind(9)pci_epf_bind(9)pci_epf_add_vepf(9)pci_epf_remove_vepf(9)pci_epf_free_space(9)pci_epf_alloc_space(9)pci_epf_unregister_driver(9)__pci_epf_register_driver(9)pci_epf_destroy(9)pci_epf_create(9)pci_epf_align_inbound_addr(9)
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
- 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