TianoCore EDK2 master
Loading...
Searching...
No Matches
NonDiscoverablePciDeviceIo.c File Reference

Go to the source code of this file.

Data Structures

struct  NON_DISCOVERABLE_PCI_DEVICE_MAP_INFO
 

Functions

STATIC EFI_STATUS GetBarResource (IN NON_DISCOVERABLE_PCI_DEVICE *Dev, IN UINT8 BarIndex, OUT EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR **Descriptor)
 
STATIC EFI_STATUS EFIAPI PciIoPollMem (IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINT64 Mask, IN UINT64 Value, IN UINT64 Delay, OUT UINT64 *Result)
 
STATIC EFI_STATUS EFIAPI PciIoPollIo (IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINT64 Mask, IN UINT64 Value, IN UINT64 Delay, OUT UINT64 *Result)
 
STATIC EFI_STATUS EFIAPI PciIoMemRW (IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINTN Count, IN UINTN DstStride, IN VOID *Dst, IN UINTN SrcStride, OUT CONST VOID *Src)
 
STATIC EFI_STATUS EFIAPI PciIoMemRead (IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINTN Count, IN OUT VOID *Buffer)
 
STATIC EFI_STATUS EFIAPI PciIoMemWrite (IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINTN Count, IN OUT VOID *Buffer)
 
STATIC EFI_STATUS EFIAPI PciIoIoRead (IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINTN Count, IN OUT VOID *Buffer)
 
STATIC EFI_STATUS EFIAPI PciIoIoWrite (IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINTN Count, IN OUT VOID *Buffer)
 
STATIC EFI_STATUS EFIAPI PciIoPciRead (IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT32 Offset, IN UINTN Count, IN OUT VOID *Buffer)
 
STATIC EFI_STATUS EFIAPI PciIoPciWrite (IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT32 Offset, IN UINTN Count, IN OUT VOID *Buffer)
 
STATIC EFI_STATUS EFIAPI PciIoCopyMem (IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 DestBarIndex, IN UINT64 DestOffset, IN UINT8 SrcBarIndex, IN UINT64 SrcOffset, IN UINTN Count)
 
STATIC EFI_STATUS EFIAPI CoherentPciIoMap (IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_OPERATION Operation, IN VOID *HostAddress, IN OUT UINTN *NumberOfBytes, OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **Mapping)
 
STATIC EFI_STATUS EFIAPI CoherentPciIoUnmap (IN EFI_PCI_IO_PROTOCOL *This, IN VOID *Mapping)
 
STATIC EFI_STATUS EFIAPI CoherentPciIoAllocateBuffer (IN EFI_PCI_IO_PROTOCOL *This, IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, OUT VOID **HostAddress, IN UINT64 Attributes)
 
STATIC EFI_STATUS EFIAPI CoherentPciIoFreeBuffer (IN EFI_PCI_IO_PROTOCOL *This, IN UINTN Pages, IN VOID *HostAddress)
 
STATIC EFI_STATUS EFIAPI NonCoherentPciIoFreeBuffer (IN EFI_PCI_IO_PROTOCOL *This, IN UINTN Pages, IN VOID *HostAddress)
 
STATIC EFI_STATUS EFIAPI NonCoherentPciIoAllocateBuffer (IN EFI_PCI_IO_PROTOCOL *This, IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, OUT VOID **HostAddress, IN UINT64 Attributes)
 
STATIC EFI_STATUS EFIAPI NonCoherentPciIoMap (IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_OPERATION Operation, IN VOID *HostAddress, IN OUT UINTN *NumberOfBytes, OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **Mapping)
 
STATIC EFI_STATUS EFIAPI NonCoherentPciIoUnmap (IN EFI_PCI_IO_PROTOCOL *This, IN VOID *Mapping)
 
STATIC EFI_STATUS EFIAPI PciIoFlush (IN EFI_PCI_IO_PROTOCOL *This)
 
STATIC EFI_STATUS EFIAPI PciIoGetLocation (IN EFI_PCI_IO_PROTOCOL *This, OUT UINTN *SegmentNumber, OUT UINTN *BusNumber, OUT UINTN *DeviceNumber, OUT UINTN *FunctionNumber)
 
STATIC EFI_STATUS EFIAPI PciIoAttributes (IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION Operation, IN UINT64 Attributes, OUT UINT64 *Result OPTIONAL)
 
STATIC EFI_STATUS EFIAPI PciIoGetBarAttributes (IN EFI_PCI_IO_PROTOCOL *This, IN UINT8 BarIndex, OUT UINT64 *Supports OPTIONAL, OUT VOID **Resources OPTIONAL)
 
STATIC EFI_STATUS EFIAPI PciIoSetBarAttributes (IN EFI_PCI_IO_PROTOCOL *This, IN UINT64 Attributes, IN UINT8 BarIndex, IN OUT UINT64 *Offset, IN OUT UINT64 *Length)
 
VOID InitializePciIoProtocol (NON_DISCOVERABLE_PCI_DEVICE *Dev)
 

Variables

STATIC CONST EFI_PCI_IO_PROTOCOL PciIoTemplate
 

Detailed Description

Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
Copyright (c) 2016, Linaro, Ltd. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file NonDiscoverablePciDeviceIo.c.

Function Documentation

◆ CoherentPciIoAllocateBuffer()

STATIC EFI_STATUS EFIAPI CoherentPciIoAllocateBuffer ( IN EFI_PCI_IO_PROTOCOL This,
IN EFI_ALLOCATE_TYPE  Type,
IN EFI_MEMORY_TYPE  MemoryType,
IN UINTN  Pages,
OUT VOID **  HostAddress,
IN UINT64  Attributes 
)

Allocates pages.

Parameters
ThisA pointer to the EFI_PCI_IO_PROTOCOL instance.
TypeThis parameter is not used and must be ignored.
MemoryTypeThe type of memory to allocate, EfiBootServicesData or EfiRuntimeServicesData.
PagesThe number of pages to allocate.
HostAddressA pointer to store the base system memory address of the allocated range.
AttributesThe requested bit mask of attributes for the allocated range.
Return values
EFI_SUCCESSThe requested memory pages were allocated.
EFI_UNSUPPORTEDAttributes is unsupported. The only legal attribute bits are MEMORY_WRITE_COMBINE and MEMORY_CACHED.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_OUT_OF_RESOURCESThe memory pages could not be allocated.

Definition at line 865 of file NonDiscoverablePciDeviceIo.c.

◆ CoherentPciIoFreeBuffer()

STATIC EFI_STATUS EFIAPI CoherentPciIoFreeBuffer ( IN EFI_PCI_IO_PROTOCOL This,
IN UINTN  Pages,
IN VOID *  HostAddress 
)

Frees memory that was allocated in function CoherentPciIoAllocateBuffer ().

Parameters
ThisA pointer to the EFI_PCI_IO_PROTOCOL instance.
PagesThe number of pages to free.
HostAddressThe base system memory address of the allocated range.
Return values
EFI_SUCCESSThe requested memory pages were freed.

Definition at line 929 of file NonDiscoverablePciDeviceIo.c.

◆ CoherentPciIoMap()

STATIC EFI_STATUS EFIAPI CoherentPciIoMap ( IN EFI_PCI_IO_PROTOCOL This,
IN EFI_PCI_IO_PROTOCOL_OPERATION  Operation,
IN VOID *  HostAddress,
IN OUT UINTN NumberOfBytes,
OUT EFI_PHYSICAL_ADDRESS DeviceAddress,
OUT VOID **  Mapping 
)

Provides the PCI controller-specific addresses needed to access system memory.

Parameters
ThisA pointer to the EFI_PCI_IO_PROTOCOL instance.
OperationIndicates if the bus master is going to read or write to system memory.
HostAddressThe system memory address to map to the PCI controller.
NumberOfBytesOn input the number of bytes to map. On output the number of bytes that were mapped.
DeviceAddressThe resulting map address for the bus master PCI controller to use to access the hosts HostAddress.
MappingA resulting value to pass to Unmap().
Return values
EFI_SUCCESSThe range was mapped for the returned NumberOfBytes.
EFI_UNSUPPORTEDThe HostAddress cannot be mapped as a common buffer.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_OUT_OF_RESOURCESThe request could not be completed due to a lack of resources.
EFI_DEVICE_ERRORThe system hardware could not map the requested address.

Definition at line 717 of file NonDiscoverablePciDeviceIo.c.

◆ CoherentPciIoUnmap()

STATIC EFI_STATUS EFIAPI CoherentPciIoUnmap ( IN EFI_PCI_IO_PROTOCOL This,
IN VOID *  Mapping 
)

Completes the Map() operation and releases any corresponding resources.

Parameters
ThisA pointer to the EFI_PCI_IO_PROTOCOL instance.
MappingThe mapping value returned from Map().
Return values
EFI_SUCCESSThe range was unmapped.

Definition at line 816 of file NonDiscoverablePciDeviceIo.c.

◆ GetBarResource()

STATIC EFI_STATUS GetBarResource ( IN NON_DISCOVERABLE_PCI_DEVICE Dev,
IN UINT8  BarIndex,
OUT EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR **  Descriptor 
)

Get the resource associated with BAR number 'BarIndex'.

Parameters
DevPoint to the NON_DISCOVERABLE_PCI_DEVICE instance.
BarIndexThe BAR index of the standard PCI Configuration header to use as the base address for the memory operation to perform.
DescriptorPoints to the address space descriptor

Definition at line 35 of file NonDiscoverablePciDeviceIo.c.

◆ InitializePciIoProtocol()

VOID InitializePciIoProtocol ( NON_DISCOVERABLE_PCI_DEVICE Dev)

Initialize PciIo Protocol.

Parameters
DevPoint to NON_DISCOVERABLE_PCI_DEVICE instance.

Definition at line 1765 of file NonDiscoverablePciDeviceIo.c.

◆ NonCoherentPciIoAllocateBuffer()

STATIC EFI_STATUS EFIAPI NonCoherentPciIoAllocateBuffer ( IN EFI_PCI_IO_PROTOCOL This,
IN EFI_ALLOCATE_TYPE  Type,
IN EFI_MEMORY_TYPE  MemoryType,
IN UINTN  Pages,
OUT VOID **  HostAddress,
IN UINT64  Attributes 
)

Allocates pages.

Parameters
ThisA pointer to the EFI_PCI_IO_PROTOCOL instance.
TypeThis parameter is not used and must be ignored.
MemoryTypeThe type of memory to allocate, EfiBootServicesData or EfiRuntimeServicesData.
PagesThe number of pages to allocate.
HostAddressA pointer to store the base system memory address of the allocated range.
AttributesThe requested bit mask of attributes for the allocated range.
Return values
EFI_SUCCESSThe requested memory pages were allocated.
EFI_UNSUPPORTEDAttributes is unsupported. The only legal attribute bits are MEMORY_WRITE_COMBINE and MEMORY_CACHED.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_OUT_OF_RESOURCESThe memory pages could not be allocated.

Definition at line 1098 of file NonDiscoverablePciDeviceIo.c.

◆ NonCoherentPciIoFreeBuffer()

STATIC EFI_STATUS EFIAPI NonCoherentPciIoFreeBuffer ( IN EFI_PCI_IO_PROTOCOL This,
IN UINTN  Pages,
IN VOID *  HostAddress 
)

Frees memory that was allocated in function NonCoherentPciIoAllocateBuffer ().

Parameters
ThisA pointer to the EFI_PCI_IO_PROTOCOL instance.
PagesThe number of pages to free.
HostAddressThe base system memory address of the allocated range.
Return values
EFI_SUCCESSThe requested memory pages were freed.
othersThe operation contain some errors.

Definition at line 953 of file NonDiscoverablePciDeviceIo.c.

◆ NonCoherentPciIoMap()

STATIC EFI_STATUS EFIAPI NonCoherentPciIoMap ( IN EFI_PCI_IO_PROTOCOL This,
IN EFI_PCI_IO_PROTOCOL_OPERATION  Operation,
IN VOID *  HostAddress,
IN OUT UINTN NumberOfBytes,
OUT EFI_PHYSICAL_ADDRESS DeviceAddress,
OUT VOID **  Mapping 
)

Provides the PCI controller-specific addresses needed to access system memory.

Parameters
ThisA pointer to the EFI_PCI_IO_PROTOCOL instance.
OperationIndicates if the bus master is going to read or write to system memory.
HostAddressThe system memory address to map to the PCI controller.
NumberOfBytesOn input the number of bytes to map. On output the number of bytes that were mapped.
DeviceAddressThe resulting map address for the bus master PCI controller to use to access the hosts HostAddress.
MappingA resulting value to pass to Unmap().
Return values
EFI_SUCCESSThe range was mapped for the returned NumberOfBytes.
EFI_UNSUPPORTEDThe HostAddress cannot be mapped as a common buffer.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_OUT_OF_RESOURCESThe request could not be completed due to a lack of resources.
EFI_DEVICE_ERRORThe system hardware could not map the requested address.

Definition at line 1259 of file NonDiscoverablePciDeviceIo.c.

◆ NonCoherentPciIoUnmap()

STATIC EFI_STATUS EFIAPI NonCoherentPciIoUnmap ( IN EFI_PCI_IO_PROTOCOL This,
IN VOID *  Mapping 
)

Completes the Map() operation and releases any corresponding resources.

Parameters
ThisA pointer to the EFI_PCI_IO_PROTOCOL instance.
MappingThe mapping value returned from Map().
Return values
EFI_SUCCESSThe range was unmapped.

Definition at line 1412 of file NonDiscoverablePciDeviceIo.c.

◆ PciIoAttributes()

STATIC EFI_STATUS EFIAPI PciIoAttributes ( IN EFI_PCI_IO_PROTOCOL This,
IN EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION  Operation,
IN UINT64  Attributes,
OUT UINT64 *Result  OPTIONAL 
)

Performs an operation on the attributes that this PCI controller supports. The operations include getting the set of supported attributes, retrieving the current attributes, setting the current attributes, enabling attributes, and disabling attributes.

Parameters
ThisA pointer to the EFI_PCI_IO_PROTOCOL instance.
OperationThe operation to perform on the attributes for this PCI controller.
AttributesThe mask of attributes that are used for Set, Enable, and Disable operations.
ResultA pointer to the result mask of attributes that are returned for the Get and Supported operations.
Return values
EFI_SUCCESSThe operation on the PCI controller's attributes was completed.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_UNSUPPORTEDone or more of the bits set in Attributes are not supported by this PCI controller or one of its parent bridges when Operation is Set, Enable or Disable.

Definition at line 1544 of file NonDiscoverablePciDeviceIo.c.

◆ PciIoCopyMem()

STATIC EFI_STATUS EFIAPI PciIoCopyMem ( IN EFI_PCI_IO_PROTOCOL This,
IN EFI_PCI_IO_PROTOCOL_WIDTH  Width,
IN UINT8  DestBarIndex,
IN UINT64  DestOffset,
IN UINT8  SrcBarIndex,
IN UINT64  SrcOffset,
IN UINTN  Count 
)

Enables a PCI driver to copy one region of PCI memory space to another region of PCI memory space.

Parameters
ThisA pointer to the EFI_PCI_IO_PROTOCOL instance.
WidthSignifies the width of the memory operations.
DestBarIndexThe BAR index in the standard PCI Configuration header to use as the base address for the memory operation to perform.
DestOffsetThe destination offset within the BAR specified by DestBarIndex to start the memory writes for the copy operation.
SrcBarIndexThe BAR index in the standard PCI Configuration header to use as the base address for the memory operation to perform.
SrcOffsetThe source offset within the BAR specified by SrcBarIndex to start the memory reads for the copy operation.
CountThe number of memory operations to perform. Bytes moved is Width size * Count, starting at DestOffset and SrcOffset.

Definition at line 652 of file NonDiscoverablePciDeviceIo.c.

◆ PciIoFlush()

STATIC EFI_STATUS EFIAPI PciIoFlush ( IN EFI_PCI_IO_PROTOCOL This)

Flushes all PCI posted write transactions from a PCI host bridge to system memory.

Parameters
ThisA pointer to the EFI_PCI_IO_PROTOCOL instance.

Definition at line 1471 of file NonDiscoverablePciDeviceIo.c.

◆ PciIoGetBarAttributes()

STATIC EFI_STATUS EFIAPI PciIoGetBarAttributes ( IN EFI_PCI_IO_PROTOCOL This,
IN UINT8  BarIndex,
OUT UINT64 *Supports  OPTIONAL,
OUT VOID **Resources  OPTIONAL 
)

Gets the attributes that this PCI controller supports setting on a BAR using SetBarAttributes(), and retrieves the list of resource descriptors for a BAR.

Parameters
ThisA pointer to the EFI_PCI_IO_PROTOCOL instance.
BarIndexThe BAR index of the standard PCI Configuration header to use as the base address for resource range. The legal range for this field is 0..5.
SupportsA pointer to the mask of attributes that this PCI controller supports setting for this BAR with SetBarAttributes().
ResourcesA pointer to the ACPI 2.0 resource descriptors that describe the current configuration of this BAR of the PCI controller.
Return values
EFI_SUCCESSIf Supports is not NULL, then the attributes that the PCI controller supports are returned in Supports. If Resources is not NULL, then the ACPI 2.0 resource descriptors that the PCI controller is currently using are returned in Resources.
EFI_INVALID_PARAMETERBoth Supports and Attributes are NULL.
EFI_UNSUPPORTEDBarIndex not valid for this PCI controller.
EFI_OUT_OF_RESOURCESThere are not enough resources available to allocate Resources.

Definition at line 1630 of file NonDiscoverablePciDeviceIo.c.

◆ PciIoGetLocation()

STATIC EFI_STATUS EFIAPI PciIoGetLocation ( IN EFI_PCI_IO_PROTOCOL This,
OUT UINTN SegmentNumber,
OUT UINTN BusNumber,
OUT UINTN DeviceNumber,
OUT UINTN FunctionNumber 
)

Retrieves this PCI controller's current PCI bus number, device number, and function number.

Parameters
ThisA pointer to the EFI_PCI_IO_PROTOCOL instance.
SegmentNumberThe PCI controller's current PCI segment number.
BusNumberThe PCI controller's current PCI bus number.
DeviceNumberThe PCI controller's current PCI device number.
FunctionNumberThe PCI controller's current PCI function number.
Return values
EFI_SUCCESSThe PCI controller location was returned.
EFI_INVALID_PARAMETEROne or more parameters are invalid.

Definition at line 1494 of file NonDiscoverablePciDeviceIo.c.

◆ PciIoIoRead()

STATIC EFI_STATUS EFIAPI PciIoIoRead ( IN EFI_PCI_IO_PROTOCOL This,
IN EFI_PCI_IO_PROTOCOL_WIDTH  Width,
IN UINT8  BarIndex,
IN UINT64  Offset,
IN UINTN  Count,
IN OUT VOID *  Buffer 
)

Enable a PCI driver to access PCI controller registers in the PCI memory or I/O space.

Parameters
ThisA pointer to the EFI_PCI_IO_PROTOCOL instance.
WidthSignifies the width of the memory or I/O operations.
BarIndexThe BAR index of the standard PCI Configuration header to use as the base address for the memory or I/O operation to perform.
OffsetThe offset within the selected BAR to start the memory or I/O operation.
CountThe number of memory or I/O operations to perform.
BufferFor read operations, the destination buffer to store the results. For write operations, the source buffer to write data from.

Definition at line 446 of file NonDiscoverablePciDeviceIo.c.

◆ PciIoIoWrite()

STATIC EFI_STATUS EFIAPI PciIoIoWrite ( IN EFI_PCI_IO_PROTOCOL This,
IN EFI_PCI_IO_PROTOCOL_WIDTH  Width,
IN UINT8  BarIndex,
IN UINT64  Offset,
IN UINTN  Count,
IN OUT VOID *  Buffer 
)

Enable a PCI driver to access PCI controller registers in the PCI memory or I/O space.

Parameters
ThisA pointer to the EFI_PCI_IO_PROTOCOL instance.
WidthSignifies the width of the memory or I/O operations.
BarIndexThe BAR index of the standard PCI Configuration header to use as the base address for the memory or I/O operation to perform.
OffsetThe offset within the selected BAR to start the memory or I/O operation.
CountThe number of memory or I/O operations to perform.
BufferFor read operations, the destination buffer to store the results. For write operations, the source buffer to write data from.

Definition at line 498 of file NonDiscoverablePciDeviceIo.c.

◆ PciIoMemRead()

STATIC EFI_STATUS EFIAPI PciIoMemRead ( IN EFI_PCI_IO_PROTOCOL This,
IN EFI_PCI_IO_PROTOCOL_WIDTH  Width,
IN UINT8  BarIndex,
IN UINT64  Offset,
IN UINTN  Count,
IN OUT VOID *  Buffer 
)

Enable a PCI driver to access PCI controller registers in the PCI memory or I/O space.

Parameters
ThisA pointer to the EFI_PCI_IO_PROTOCOL instance.
WidthSignifies the width of the memory or I/O operations.
BarIndexThe BAR index of the standard PCI Configuration header to use as the base address for the memory or I/O operation to perform.
OffsetThe offset within the selected BAR to start the memory or I/O operation.
CountThe number of memory or I/O operations to perform.
BufferFor read operations, the destination buffer to store the results. For write operations, the source buffer to write data from.
Return values
EFI_SUCCESSThe data was read from or written to the PCI controller.
EFI_UNSUPPORTEDBarIndex not valid for this PCI controller.
EFI_UNSUPPORTEDThe address range specified by Offset, Width, and Count is not valid for the PCI BAR specified by BarIndex.
EFI_OUT_OF_RESOURCESThe request could not be completed due to a lack of resources.
EFI_INVALID_PARAMETEROne or more parameters are invalid.

Definition at line 277 of file NonDiscoverablePciDeviceIo.c.

◆ PciIoMemRW()

STATIC EFI_STATUS EFIAPI PciIoMemRW ( IN EFI_PCI_IO_PROTOCOL_WIDTH  Width,
IN UINTN  Count,
IN UINTN  DstStride,
IN VOID *  Dst,
IN UINTN  SrcStride,
OUT CONST VOID *  Src 
)

Enable a PCI driver to access PCI controller registers in the PCI memory or I/O space.

Parameters
WidthSignifies the width of the memory or I/O operations.
CountThe number of memory or I/O operations to perform.
DstStrideThe stride of the destination buffer.
DstFor read operations, the destination buffer to store the results. For write operations, the destination buffer to write data to.
SrcStrideThe stride of the source buffer.
SrcFor read operations, the source buffer to read data from. For write operations, the source buffer to write data from.
Return values
EFI_SUCCESSThe data was read from or written to the PCI controller.
EFI_INVALID_PARAMETEROne or more parameters are invalid.

Definition at line 203 of file NonDiscoverablePciDeviceIo.c.

◆ PciIoMemWrite()

STATIC EFI_STATUS EFIAPI PciIoMemWrite ( IN EFI_PCI_IO_PROTOCOL This,
IN EFI_PCI_IO_PROTOCOL_WIDTH  Width,
IN UINT8  BarIndex,
IN UINT64  Offset,
IN UINTN  Count,
IN OUT VOID *  Buffer 
)

Enable a PCI driver to access PCI controller registers in the PCI memory or I/O space.

Parameters
ThisA pointer to the EFI_PCI_IO_PROTOCOL instance.
WidthSignifies the width of the memory or I/O operations.
BarIndexThe BAR index of the standard PCI Configuration header to use as the base address for the memory or I/O operation to perform.
OffsetThe offset within the selected BAR to start the memory or I/O operation.
CountThe number of memory or I/O operations to perform.
BufferFor read operations, the destination buffer to store the results. For write operations, the source buffer to write data from.
Return values
EFI_SUCCESSThe data was read from or written to the PCI controller.
EFI_UNSUPPORTEDBarIndex not valid for this PCI controller.
EFI_UNSUPPORTEDThe address range specified by Offset, Width, and Count is not valid for the PCI BAR specified by BarIndex.
EFI_OUT_OF_RESOURCESThe request could not be completed due to a lack of resources.
EFI_INVALID_PARAMETEROne or more parameters are invalid.

Definition at line 365 of file NonDiscoverablePciDeviceIo.c.

◆ PciIoPciRead()

STATIC EFI_STATUS EFIAPI PciIoPciRead ( IN EFI_PCI_IO_PROTOCOL This,
IN EFI_PCI_IO_PROTOCOL_WIDTH  Width,
IN UINT32  Offset,
IN UINTN  Count,
IN OUT VOID *  Buffer 
)

Enable a PCI driver to access PCI config space.

Parameters
ThisA pointer to the EFI_PCI_IO_PROTOCOL instance.
WidthSignifies the width of the memory or I/O operations.
OffsetThe offset within the selected BAR to start the memory or I/O operation.
CountThe number of memory or I/O operations to perform.
BufferFor read operations, the destination buffer to store the results. For write operations, the source buffer to write data from.

Definition at line 548 of file NonDiscoverablePciDeviceIo.c.

◆ PciIoPciWrite()

STATIC EFI_STATUS EFIAPI PciIoPciWrite ( IN EFI_PCI_IO_PROTOCOL This,
IN EFI_PCI_IO_PROTOCOL_WIDTH  Width,
IN UINT32  Offset,
IN UINTN  Count,
IN OUT VOID *  Buffer 
)

Enable a PCI driver to access PCI config space.

Parameters
ThisA pointer to the EFI_PCI_IO_PROTOCOL instance.
WidthSignifies the width of the memory or I/O operations.
OffsetThe offset within the selected BAR to start the memory or I/O operation.
CountThe number of memory or I/O operations to perform.
BufferFor read operations, the destination buffer to store the results. For write operations, the source buffer to write data from
Return values
EFI_SUCCESSThe data was read from or written to the PCI controller.
EFI_UNSUPPORTEDThe address range specified by Offset, Width, and Count is not valid for the PCI BAR specified by BarIndex.
EFI_INVALID_PARAMETEROne or more parameters are invalid.

Definition at line 606 of file NonDiscoverablePciDeviceIo.c.

◆ PciIoPollIo()

STATIC EFI_STATUS EFIAPI PciIoPollIo ( IN EFI_PCI_IO_PROTOCOL This,
IN EFI_PCI_IO_PROTOCOL_WIDTH  Width,
IN UINT8  BarIndex,
IN UINT64  Offset,
IN UINT64  Mask,
IN UINT64  Value,
IN UINT64  Delay,
OUT UINT64 *  Result 
)

Reads from the memory space of a PCI controller. Returns either when the polling exit criteria is satisfied or after a defined duration.

Parameters
ThisA pointer to the EFI_PCI_IO_PROTOCOL instance.
WidthSignifies the width of the memory or I/O operations.
BarIndexThe BAR index of the standard PCI Configuration header to use as the base address for the memory operation to perform.
OffsetThe offset within the selected BAR to start the memory operation.
MaskMask used for the polling criteria.
ValueThe comparison value used for the polling exit criteria.
DelayThe number of 100 ns units to poll.
ResultPointer to the last value read from the memory location.

Definition at line 144 of file NonDiscoverablePciDeviceIo.c.

◆ PciIoPollMem()

STATIC EFI_STATUS EFIAPI PciIoPollMem ( IN EFI_PCI_IO_PROTOCOL This,
IN EFI_PCI_IO_PROTOCOL_WIDTH  Width,
IN UINT8  BarIndex,
IN UINT64  Offset,
IN UINT64  Mask,
IN UINT64  Value,
IN UINT64  Delay,
OUT UINT64 *  Result 
)

Reads from the memory space of a PCI controller. Returns either when the polling exit criteria is satisfied or after a defined duration.

Parameters
ThisA pointer to the EFI_PCI_IO_PROTOCOL instance.
WidthSignifies the width of the memory or I/O operations.
BarIndexThe BAR index of the standard PCI Configuration header to use as the base address for the memory operation to perform.
OffsetThe offset within the selected BAR to start the memory operation.
MaskMask used for the polling criteria.
ValueThe comparison value used for the polling exit criteria.
DelayThe number of 100 ns units to poll.
ResultPointer to the last value read from the memory location.

Definition at line 86 of file NonDiscoverablePciDeviceIo.c.

◆ PciIoSetBarAttributes()

STATIC EFI_STATUS EFIAPI PciIoSetBarAttributes ( IN EFI_PCI_IO_PROTOCOL This,
IN UINT64  Attributes,
IN UINT8  BarIndex,
IN OUT UINT64 *  Offset,
IN OUT UINT64 *  Length 
)

Sets the attributes for a range of a BAR on a PCI controller.

Parameters
ThisA pointer to the EFI_PCI_IO_PROTOCOL instance.
AttributesThe mask of attributes to set for the resource range specified by BarIndex, Offset, and Length.
BarIndexThe BAR index of the standard PCI Configuration header to use as the base address for resource range. The legal range for this field is 0..5.
OffsetA pointer to the BAR relative base address of the resource range to be modified by the attributes specified by Attributes.
LengthA pointer to the length of the resource range to be modified by the attributes specified by Attributes.

Definition at line 1698 of file NonDiscoverablePciDeviceIo.c.

Variable Documentation

◆ PciIoTemplate

Initial value:
=
{
0,
0
}
STATIC EFI_STATUS EFIAPI CoherentPciIoFreeBuffer(IN EFI_PCI_IO_PROTOCOL *This, IN UINTN Pages, IN VOID *HostAddress)
STATIC EFI_STATUS EFIAPI CoherentPciIoAllocateBuffer(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, OUT VOID **HostAddress, IN UINT64 Attributes)
STATIC EFI_STATUS EFIAPI PciIoGetBarAttributes(IN EFI_PCI_IO_PROTOCOL *This, IN UINT8 BarIndex, OUT UINT64 *Supports OPTIONAL, OUT VOID **Resources OPTIONAL)
STATIC EFI_STATUS EFIAPI PciIoCopyMem(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 DestBarIndex, IN UINT64 DestOffset, IN UINT8 SrcBarIndex, IN UINT64 SrcOffset, IN UINTN Count)
STATIC EFI_STATUS EFIAPI PciIoIoWrite(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINTN Count, IN OUT VOID *Buffer)
STATIC EFI_STATUS EFIAPI CoherentPciIoMap(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_OPERATION Operation, IN VOID *HostAddress, IN OUT UINTN *NumberOfBytes, OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **Mapping)
STATIC EFI_STATUS EFIAPI PciIoGetLocation(IN EFI_PCI_IO_PROTOCOL *This, OUT UINTN *SegmentNumber, OUT UINTN *BusNumber, OUT UINTN *DeviceNumber, OUT UINTN *FunctionNumber)
STATIC EFI_STATUS EFIAPI PciIoFlush(IN EFI_PCI_IO_PROTOCOL *This)
STATIC EFI_STATUS EFIAPI CoherentPciIoUnmap(IN EFI_PCI_IO_PROTOCOL *This, IN VOID *Mapping)
STATIC EFI_STATUS EFIAPI PciIoPciWrite(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT32 Offset, IN UINTN Count, IN OUT VOID *Buffer)
STATIC EFI_STATUS EFIAPI PciIoAttributes(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION Operation, IN UINT64 Attributes, OUT UINT64 *Result OPTIONAL)
STATIC EFI_STATUS EFIAPI PciIoPciRead(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT32 Offset, IN UINTN Count, IN OUT VOID *Buffer)
STATIC EFI_STATUS EFIAPI PciIoIoRead(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINTN Count, IN OUT VOID *Buffer)
STATIC EFI_STATUS EFIAPI PciIoPollMem(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINT64 Mask, IN UINT64 Value, IN UINT64 Delay, OUT UINT64 *Result)
STATIC EFI_STATUS EFIAPI PciIoMemWrite(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINTN Count, IN OUT VOID *Buffer)
STATIC EFI_STATUS EFIAPI PciIoMemRead(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINTN Count, IN OUT VOID *Buffer)
STATIC EFI_STATUS EFIAPI PciIoSetBarAttributes(IN EFI_PCI_IO_PROTOCOL *This, IN UINT64 Attributes, IN UINT8 BarIndex, IN OUT UINT64 *Offset, IN OUT UINT64 *Length)
STATIC EFI_STATUS EFIAPI PciIoPollIo(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINT64 Mask, IN UINT64 Value, IN UINT64 Delay, OUT UINT64 *Result)

Definition at line 1737 of file NonDiscoverablePciDeviceIo.c.