pci_epf_alloc_space(9)
β¨ pci_epf_alloc_space(9) β¨
Okay so bestie, welcome to the Kernel API Manual entry for pci_epf_alloc_space β this is the function that grabs you some memory for the PCI EPF register space. Yes it's a real kernel function, no it's not scary, we're gonna get through it together π
πΈ NAME πΈ
pci_epf_alloc_space β allocate memory for the PCI EPF register space
Like, that's literally the whole vibe. You want register space memory? This is the girl handing it out. π
β SYNOPSIS β
void * pci_epf_alloc_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 );
Five arguments, one pointer back, and a whole lotta PCI going on. Not me counting the params three times π
π¦ ARGUMENTS π¦
epfβ the EPF device that's getting the memory. Like, the actual main character receiving the allocation. Slay πsizeβ how much memory you're asking for, in bytes. Respectfully, the whole point of the call.barβ the BAR number that goes with the register space you just allocated. It's anenum pci_barno, so know your number, bestie β¨epc_featuresβ the features that the EPC provides, specifically for this EPF. Lowkey the personality check of the operation.typeβ tells you whether the allocation is for the primary EPC or the secondary EPC. Two EPCs, two vibes, pick one π«Ά
π₯ DESCRIPTION π₯
Invoke this when you need to allocate memory for the PCI EPF register space. That's the assignment, and it ate. π
Now here's the fun part (iykyk): the flag PCI_BASE_ADDRESS_MEM_TYPE_64 will automatically get set if either of these is true:
- the BAR can only be a 64-bit BAR, or
- the requested size is larger than 2 GB
So you don't even have to think about it β the function clocked it and handled it for you. Not me being obsessed with automatic flag setting πβ¨
π SEE ALSO π
Kernel file ./drivers/pci/endpoint/pci-epf-core.c β and like, 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_assign_bar_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)
Go read all of them, bestie. Group chat's waiting π§π
Alright, signing off! This little page lives in the kernel source tree at ./drivers/pci/endpoint, dated October 2026, and it's filed under pci_epf_alloc_space(9) β literally iconic, no cap ππ¦πΈ
π¦ 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