aboutsummaryrefslogtreecommitdiff
path: root/src/include/ipxe/efi
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2020-11-04 15:08:48 +0000
committerMichael Brown <mcb30@ipxe.org>2020-11-04 15:16:22 +0000
commit36dde9b0bf27ae411af677ca1fa3075113133cfe (patch)
treee9f2cc06c015068c973a8b243943a4a4d3ac67f2 /src/include/ipxe/efi
parentf560e7b70b5b1a3ecd2d03d8f319e79327dbd6c3 (diff)
downloadipxe-36dde9b0bf27ae411af677ca1fa3075113133cfe.zip
ipxe-36dde9b0bf27ae411af677ca1fa3075113133cfe.tar.gz
ipxe-36dde9b0bf27ae411af677ca1fa3075113133cfe.tar.bz2
[efi] Retain a long-lived reference to the EFI_PCI_IO_PROTOCOL instance
Provide opened EFI PCI devices with access to the underlying EFI_PCI_IO_PROTOCOL instance, in order to facilitate the future use of the DMA mapping methods within the fast data path. Do not require the use of this stored EFI_PCI_IO_PROTOCOL instance for memory-mapped I/O (since the entire point of memory-mapped I/O as a concept is to avoid this kind of unnecessary complexity) or for slow-path PCI configuration space accesses (since these may be required for access to PCI bus:dev.fn addresses that do not correspond to a device bound via our driver binding protocol instance). Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/efi')
-rw-r--r--src/include/ipxe/efi/efi_pci.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/include/ipxe/efi/efi_pci.h b/src/include/ipxe/efi/efi_pci.h
index 6dd945f..2ea1a8f 100644
--- a/src/include/ipxe/efi/efi_pci.h
+++ b/src/include/ipxe/efi/efi_pci.h
@@ -17,9 +17,17 @@ static inline EFIAPI uint64_t LShiftU64 ( UINT64 value, UINTN shift ) {
return ( value << shift );
}
+/** An EFI PCI device */
+struct efi_pci_device {
+ /** PCI device */
+ struct pci_device pci;
+ /** PCI I/O protocol */
+ EFI_PCI_IO_PROTOCOL *io;
+};
+
extern int efipci_open ( EFI_HANDLE device, UINT32 attributes,
- struct pci_device *pci );
+ struct efi_pci_device *efipci );
extern void efipci_close ( EFI_HANDLE device );
-extern int efipci_info ( EFI_HANDLE device, struct pci_device *pci );
+extern int efipci_info ( EFI_HANDLE device, struct efi_pci_device *efipci );
#endif /* _IPXE_EFI_PCI_H */