pci_epf_align_inbound_addr(9)
β¨ pci_epf_align_inbound_addr β¨
okay so bestie, this is a page from the Kernel API Manual β it's pci_epf_align_inbound_addr(9) and it's genuinely one of those little helper functions that just does its job and slays. let's get into it π
πΈ NAME πΈ
pci_epf_align_inbound_addr β aligns the address you hand it so it actually matches the BAR alignment requirement, no cap π
π¦ SYNOPSIS π¦
int pci_epf_align_inbound_addr (struct pci_epf *epf , enum pci_barno bar
, u64 addr , dma_addr_t *base , size_t *off );
like, five args, one int back. she's compact. she's iconic. π«Ά
π ARGUMENTS π
epfβ the EPF device itself, the main character here πbarβ the BAR number that goes with theaddryou're passing inaddrβ the inbound address that's about to get aligned, glow-up incoming β¨baseβ out-param: gets the base address that matches the bar alignment requirementoffβ out-param: gets the offset you need to add to that base address
π DESCRIPTION π
so this is a helper function that aligns the input addr based on the BAR's alignment requirement. that's literally it, and that's the vibe π
the aligned base address and the offset both come back out through base and off β so you don't return them, you hand her the pointers and she fills them in. lowkey elegant.
β NOTE β
ngl, important one: pci_epf_alloc_space already accounts for alignment. so don't come for this function thinking it's for memory you got from there π
this API is primarily intended for use with other memory regions not allocated by pci_epf_alloc_space β like peripheral register spaces, or the message address of a platform MSI controller. iykyk π§
π RETURN π
0 on success, errno otherwise. that's the whole story bestie π
π₯ 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_assign_bar_space(9)pci_epf_unregister_driver(9)__pci_epf_register_driver(9)pci_epf_destroy(9)pci_epf_create(9)
and that's the page!! π this one lives over in ./drivers/pci/endpoint, dated October 2026, and it's filed under pci_epf_align_inbound_addr(9) β go off, alignment function, periodt π
β¨
π¦ 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