pci_epf_align_inbound_addr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 the addr you're passing in
  • addr β€” the inbound address that's about to get aligned, glow-up incoming ✨
  • base β€” out-param: gets the base address that matches the bar alignment requirement
  • off β€” 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:


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