TianoCore EDK2 master
Loading...
Searching...
No Matches
PciRootBridge.h File Reference

Go to the source code of this file.

Data Structures

struct  MAP_INFO
 
struct  PCI_ROOT_BRIDGE_INSTANCE
 

Macros

#define MAP_INFO_SIGNATURE   SIGNATURE_32 ('_', 'm', 'a', 'p')
 
#define MAP_INFO_FROM_LINK(a)   CR (a, MAP_INFO, Link, MAP_INFO_SIGNATURE)
 
#define PCI_ROOT_BRIDGE_SIGNATURE   SIGNATURE_32 ('_', 'p', 'r', 'b')
 
#define ROOT_BRIDGE_FROM_THIS(a)   CR (a, PCI_ROOT_BRIDGE_INSTANCE, RootBridgeIo, PCI_ROOT_BRIDGE_SIGNATURE)
 
#define ROOT_BRIDGE_FROM_LINK(a)   CR (a, PCI_ROOT_BRIDGE_INSTANCE, Link, PCI_ROOT_BRIDGE_SIGNATURE)
 

Enumerations

enum  OPERATION_TYPE { IoOperation , MemOperation , PciOperation }
 

Functions

PCI_ROOT_BRIDGE_INSTANCECreateRootBridge (IN PCI_ROOT_BRIDGE *Bridge)
 
EFI_STATUS EFIAPI RootBridgeIoPollMem (IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 Address, IN UINT64 Mask, IN UINT64 Value, IN UINT64 Delay, OUT UINT64 *Result)
 
EFI_STATUS EFIAPI RootBridgeIoPollIo (IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 Address, IN UINT64 Mask, IN UINT64 Value, IN UINT64 Delay, OUT UINT64 *Result)
 
EFI_STATUS EFIAPI RootBridgeIoMemRead (IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN OUT VOID *Buffer)
 
EFI_STATUS EFIAPI RootBridgeIoMemWrite (IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN OUT VOID *Buffer)
 
EFI_STATUS EFIAPI RootBridgeIoIoRead (IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 UserAddress, IN UINTN Count, IN OUT VOID *UserBuffer)
 
EFI_STATUS EFIAPI RootBridgeIoIoWrite (IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 UserAddress, IN UINTN Count, IN OUT VOID *UserBuffer)
 
EFI_STATUS EFIAPI RootBridgeIoCopyMem (IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 DestAddress, IN UINT64 SrcAddress, IN UINTN Count)
 
EFI_STATUS EFIAPI RootBridgeIoPciRead (IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN OUT VOID *Buffer)
 
EFI_STATUS EFIAPI RootBridgeIoPciWrite (IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN OUT VOID *Buffer)
 
EFI_STATUS EFIAPI RootBridgeIoMap (IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION Operation, IN VOID *HostAddress, IN OUT UINTN *NumberOfBytes, OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **Mapping)
 
EFI_STATUS EFIAPI RootBridgeIoUnmap (IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN VOID *Mapping)
 
EFI_STATUS EFIAPI RootBridgeIoAllocateBuffer (IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, OUT VOID **HostAddress, IN UINT64 Attributes)
 
EFI_STATUS EFIAPI RootBridgeIoFreeBuffer (IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN UINTN Pages, OUT VOID *HostAddress)
 
EFI_STATUS EFIAPI RootBridgeIoFlush (IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This)
 
EFI_STATUS EFIAPI RootBridgeIoGetAttributes (IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, OUT UINT64 *Supported, OUT UINT64 *Attributes)
 
EFI_STATUS EFIAPI RootBridgeIoSetAttributes (IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN UINT64 Attributes, IN OUT UINT64 *ResourceBase, IN OUT UINT64 *ResourceLength)
 
EFI_STATUS EFIAPI RootBridgeIoConfiguration (IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, OUT VOID **Resources)
 

Variables

EFI_CPU_IO2_PROTOCOLmCpuIo
 

Detailed Description

The PCI Root Bridge header file.

Copyright (c) 1999 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file PciRootBridge.h.

Macro Definition Documentation

◆ MAP_INFO_FROM_LINK

#define MAP_INFO_FROM_LINK (   a)    CR (a, MAP_INFO, Link, MAP_INFO_SIGNATURE)

Definition at line 50 of file PciRootBridge.h.

◆ MAP_INFO_SIGNATURE

#define MAP_INFO_SIGNATURE   SIGNATURE_32 ('_', 'm', 'a', 'p')

Definition at line 40 of file PciRootBridge.h.

◆ PCI_ROOT_BRIDGE_SIGNATURE

#define PCI_ROOT_BRIDGE_SIGNATURE   SIGNATURE_32 ('_', 'p', 'r', 'b')

Definition at line 52 of file PciRootBridge.h.

◆ ROOT_BRIDGE_FROM_LINK

#define ROOT_BRIDGE_FROM_LINK (   a)    CR (a, PCI_ROOT_BRIDGE_INSTANCE, Link, PCI_ROOT_BRIDGE_SIGNATURE)

Definition at line 81 of file PciRootBridge.h.

◆ ROOT_BRIDGE_FROM_THIS

#define ROOT_BRIDGE_FROM_THIS (   a)    CR (a, PCI_ROOT_BRIDGE_INSTANCE, RootBridgeIo, PCI_ROOT_BRIDGE_SIGNATURE)

Definition at line 79 of file PciRootBridge.h.

Enumeration Type Documentation

◆ OPERATION_TYPE

enum OPERATION_TYPE

Definition at line 34 of file PciRootBridge.h.

Function Documentation

◆ CreateRootBridge()

PCI_ROOT_BRIDGE_INSTANCE * CreateRootBridge ( IN PCI_ROOT_BRIDGE Bridge)

Construct the Pci Root Bridge instance.

Parameters
BridgeThe root bridge instance.
Returns
The pointer to PCI_ROOT_BRIDGE_INSTANCE just created or NULL if creation fails.

Definition at line 63 of file PciRootBridgeIo.c.

◆ RootBridgeIoAllocateBuffer()

EFI_STATUS EFIAPI RootBridgeIoAllocateBuffer ( IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL This,
IN EFI_ALLOCATE_TYPE  Type,
IN EFI_MEMORY_TYPE  MemoryType,
IN UINTN  Pages,
OUT VOID **  HostAddress,
IN UINT64  Attributes 
)

Allocates pages that are suitable for an EfiPciOperationBusMasterCommonBuffer or EfiPciOperationBusMasterCommonBuffer64 mapping.

Parameters
ThisA pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
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. Only the attributes EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE, EFI_PCI_ATTRIBUTE_MEMORY_CACHED, and EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE may be used with this function.
Return values
EFI_SUCCESSThe requested memory pages were allocated.
EFI_INVALID_PARAMETERMemoryType is invalid.
EFI_INVALID_PARAMETERHostAddress is NULL.
EFI_UNSUPPORTEDAttributes is unsupported. The only legal attribute bits are MEMORY_WRITE_COMBINE, MEMORY_CACHED, and DUAL_ADDRESS_CYCLE.
EFI_OUT_OF_RESOURCESThe memory pages could not be allocated.

Definition at line 1598 of file PciRootBridgeIo.c.

◆ RootBridgeIoConfiguration()

EFI_STATUS EFIAPI RootBridgeIoConfiguration ( IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL This,
OUT VOID **  Resources 
)

Retrieves the current resource settings of this PCI root bridge in the form of a set of ACPI resource descriptor.

Parameters
This- Pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instance.
Resources- Pointer to the resource descriptor that describe the current configuration of this PCI root bridge.
Return values
EFI_SUCCESS- Success.
EFI_UNSUPPORTED- Current configuration of the PCI root bridge
couldnot be retrieved.

Retrieves the current resource settings of this PCI root bridge in the form of a set of ACPI resource descriptors.

There are only two resource descriptor types from the ACPI Specification that may be used to describe the current resources allocated to a PCI root bridge. These are the QWORD Address Space Descriptor, and the End Tag. The QWORD Address Space Descriptor can describe memory, I/O, and bus number ranges for dynamic or fixed resources. The configuration of a PCI root bridge is described with one or more QWORD Address Space Descriptors followed by an End Tag.

Parameters
[in]ThisA pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
[out]ResourcesA pointer to the resource descriptors that describe the current configuration of this PCI root bridge. The storage for the resource descriptors is allocated by this function. The caller must treat the return buffer as read-only data, and the buffer must not be freed by the caller.
Return values
EFI_SUCCESSThe current configuration of this PCI root bridge was returned in Resources.
EFI_UNSUPPORTEDThe current configuration of this PCI root bridge could not be retrieved.

Definition at line 1882 of file PciRootBridgeIo.c.

◆ RootBridgeIoCopyMem()

EFI_STATUS EFIAPI RootBridgeIoCopyMem ( IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL This,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH  Width,
IN UINT64  DestAddress,
IN UINT64  SrcAddress,
IN UINTN  Count 
)

Copy one region of PCI root bridge memory space to be copied to another region of PCI root bridge memory space.

Parameters
This- A pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instance.
Width- Signifies the width of the memory operation.
DestAddress- Destination address of the memory operation.
SrcAddress- Source address of the memory operation.
Count- Number of memory operations to perform.
Return values
EFI_SUCCESS- The data was copied successfully.
EFI_INVALID_PARAMETER- Invalid parameters found.
EFI_OUT_OF_RESOURCES- The request could not be completed due to a lack of
resources.

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

The CopyMem() function enables a PCI driver to copy one region of PCI root bridge memory space to another region of PCI root bridge memory space. This is especially useful for video scroll operation on a memory mapped video buffer. The memory operations are carried out exactly as requested. The caller is responsible for satisfying any alignment and memory width restrictions that a PCI root bridge on a platform might require.

Parameters
[in]ThisA pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instance.
[in]WidthSignifies the width of the memory operations.
[in]DestAddressThe destination address of the memory operation. The caller is responsible for aligning the DestAddress if required.
[in]SrcAddressThe source address of the memory operation. The caller is responsible for aligning the SrcAddress if required.
[in]CountThe number of memory operations to perform. Bytes moved is Width size * Count, starting at DestAddress and SrcAddress.
Return values
EFI_SUCCESSThe data was copied from one memory region to another memory region.
EFI_INVALID_PARAMETERWidth is invalid for this PCI root bridge.
EFI_OUT_OF_RESOURCESThe request could not be completed due to a lack of resources.

Definition at line 1102 of file PciRootBridgeIo.c.

◆ RootBridgeIoFlush()

EFI_STATUS EFIAPI RootBridgeIoFlush ( IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL This)

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

Parameters
This- Pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instance.
Return values
EFI_SUCCESS- PCI posted write transactions were flushed
fromPCI host bridge to system memory.
EFI_DEVICE_ERROR- Fail due to hardware error.

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

The Flush() function flushes any PCI posted write transactions from a PCI host bridge to system memory. Posted write transactions are generated by PCI bus masters when they perform write transactions to target addresses in system memory. This function does not flush posted write transactions from any PCI bridges. A PCI controller specific action must be taken to guarantee that the posted write transactions have been flushed from the PCI controller and from all the PCI bridges into the PCI host bridge. This is typically done with a PCI read transaction from the PCI controller prior to calling Flush().

Parameters
ThisA pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
Return values
EFI_SUCCESSThe PCI posted write transactions were flushed from the PCI host bridge to system memory.
EFI_DEVICE_ERRORThe PCI posted write transactions were not flushed from the PCI host bridge due to a hardware error.

Definition at line 1740 of file PciRootBridgeIo.c.

◆ RootBridgeIoFreeBuffer()

EFI_STATUS EFIAPI RootBridgeIoFreeBuffer ( IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL This,
IN UINTN  Pages,
OUT VOID *  HostAddress 
)

Free memory allocated in AllocateBuffer.

Parameters
This- Pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instance.
Pages- Number of pages to free.
HostAddress- The base system memory address of the allocated range.
Return values
EFI_SUCCESS- Requested memory pages were freed.
EFI_INVALID_PARAMETER- Invalid parameter found.

Frees memory that was allocated with AllocateBuffer().

The FreeBuffer() function frees memory that was allocated with AllocateBuffer().

Parameters
ThisA pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
PagesThe number of pages to free.
HostAddressThe base system memory address of the allocated range.
Return values
EFI_SUCCESSThe requested memory pages were freed.
EFI_INVALID_PARAMETERThe memory range specified by HostAddress and Pages was not allocated with AllocateBuffer().

Definition at line 1697 of file PciRootBridgeIo.c.

◆ RootBridgeIoGetAttributes()

EFI_STATUS EFIAPI RootBridgeIoGetAttributes ( IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL This,
OUT UINT64 *  Supported,
OUT UINT64 *  Attributes 
)

Gets the attributes that a PCI root bridge supports setting with SetAttributes(), and the attributes that a PCI root bridge is currently using.

The GetAttributes() function returns the mask of attributes that this PCI root bridge supports and the mask of attributes that the PCI root bridge is currently using.

Parameters
ThisA pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
SupportedA pointer to the mask of attributes that this PCI root bridge supports setting with SetAttributes().
AttributesA pointer to the mask of attributes that this PCI root bridge is currently using.
Return values
EFI_SUCCESSIf Supports is not NULL, then the attributes that the PCI root bridge supports is returned in Supports. If Attributes is not NULL, then the attributes that the PCI root bridge is currently using is returned in Attributes.
EFI_INVALID_PARAMETERBoth Supports and Attributes are NULL.

Definition at line 1771 of file PciRootBridgeIo.c.

◆ RootBridgeIoIoRead()

EFI_STATUS EFIAPI RootBridgeIoIoRead ( IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL This,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH  Width,
IN UINT64  UserAddress,
IN UINTN  Count,
IN OUT VOID *  UserBuffer 
)

Enable a PCI driver to read PCI controller registers in the PCI root bridge I/O space.

Parameters
This- A pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL
Width- Signifies the width of the memory operation.
UserAddress- The base address of the I/O operation.
Count- The number of I/O operations to perform.
UserBuffer- The destination buffer to store the results.
Return values
EFI_SUCCESS- The data was read from the PCI root bridge.
EFI_INVALID_PARAMETER- Invalid parameters found.
EFI_OUT_OF_RESOURCES- The request could not be completed due to a lack of
resources.

◆ RootBridgeIoIoWrite()

EFI_STATUS EFIAPI RootBridgeIoIoWrite ( IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL This,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH  Width,
IN UINT64  UserAddress,
IN UINTN  Count,
IN OUT VOID *  UserBuffer 
)

Enable a PCI driver to write to PCI controller registers in the PCI root bridge I/O space.

Parameters
This- A pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL
Width- Signifies the width of the memory operation.
UserAddress- The base address of the I/O operation.
Count- The number of I/O operations to perform.
UserBuffer- The source buffer to write data from.
Return values
EFI_SUCCESS- The data was written to the PCI root bridge.
EFI_INVALID_PARAMETER- Invalid parameters found.
EFI_OUT_OF_RESOURCES- The request could not be completed due to a lack of
resources.

◆ RootBridgeIoMap()

EFI_STATUS EFIAPI RootBridgeIoMap ( IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL This,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION  Operation,
IN VOID *  HostAddress,
IN OUT UINTN NumberOfBytes,
OUT EFI_PHYSICAL_ADDRESS DeviceAddress,
OUT VOID **  Mapping 
)

Provides the PCI controller-specific address needed to access system memory for DMA.

Parameters
ThisA pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
OperationIndicate if the bus master is going to read or write to system memory.
HostAddressThe system memory address to map on 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 system memory's HostAddress.
MappingThe value to pass to Unmap() when the bus master DMA operation is complete.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameters found.
EFI_UNSUPPORTEDThe HostAddress cannot be mapped as a common buffer.
EFI_DEVICE_ERRORThe System hardware could not map the requested address.
EFI_OUT_OF_RESOURCESThe request could not be completed due to lack of resources.

Definition at line 1331 of file PciRootBridgeIo.c.

◆ RootBridgeIoMemRead()

EFI_STATUS EFIAPI RootBridgeIoMemRead ( IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL This,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH  Width,
IN UINT64  Address,
IN UINTN  Count,
IN OUT VOID *  Buffer 
)

Allow read from memory mapped I/O space.

Parameters
This- Pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instance.
Width- The width of memory operation.
Address- Base address of the memory operation.
Count- Number of memory opeartion to perform.
Buffer- The destination buffer to store data.
Return values
EFI_SUCCESS- Success.
EFI_INVALID_PARAMETER- Invalid parameter found.
EFI_OUT_OF_RESOURCES- Fail due to lack of resources.

◆ RootBridgeIoMemWrite()

EFI_STATUS EFIAPI RootBridgeIoMemWrite ( IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL This,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH  Width,
IN UINT64  Address,
IN UINTN  Count,
IN OUT VOID *  Buffer 
)

Allow write to memory mapped I/O space.

Parameters
This- Pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instance.
Width- The width of memory operation.
Address- Base address of the memory operation.
Count- Number of memory opeartion to perform.
Buffer- The source buffer to write data from.
Return values
EFI_SUCCESS- Success.
EFI_INVALID_PARAMETER- Invalid parameter found.
EFI_OUT_OF_RESOURCES- Fail due to lack of resources.

◆ RootBridgeIoPciRead()

EFI_STATUS EFIAPI RootBridgeIoPciRead ( IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL This,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH  Width,
IN UINT64  Address,
IN UINTN  Count,
IN OUT VOID *  Buffer 
)

Allows read from PCI configuration space.

Parameters
This- A pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL
Width- Signifies the width of the memory operation.
Address- The address within the PCI configuration space for the PCI controller.
Count- The number of PCI configuration operations to perform.
Buffer- The destination buffer to store the results.
Return values
EFI_SUCCESS- The data was read from the PCI root bridge.
EFI_INVALID_PARAMETER- Invalid parameters found.
EFI_OUT_OF_RESOURCES- The request could not be completed due to a lack of
resources.

Allows read from PCI configuration space.

Parameters
ThisA pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL
WidthSignifies the width of the memory operation.
AddressThe address within the PCI configuration space for the PCI controller.
CountThe number of PCI configuration operations to perform.
BufferThe destination buffer to store the results.
Return values
EFI_SUCCESSThe data was read from the PCI root bridge.
EFI_INVALID_PARAMETERInvalid parameters found.

Definition at line 1270 of file PciRootBridgeIo.c.

◆ RootBridgeIoPciWrite()

EFI_STATUS EFIAPI RootBridgeIoPciWrite ( IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL This,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH  Width,
IN UINT64  Address,
IN UINTN  Count,
IN OUT VOID *  Buffer 
)

Allows write to PCI configuration space.

Parameters
This- A pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL
Width- Signifies the width of the memory operation.
Address- The address within the PCI configuration space for the PCI controller.
Count- The number of PCI configuration operations to perform.
Buffer- The source buffer to get the results.
Return values
EFI_SUCCESS- The data was written to the PCI root bridge.
EFI_INVALID_PARAMETER- Invalid parameters found.
EFI_OUT_OF_RESOURCES- The request could not be completed due to a lack of
resources.

Allows write to PCI configuration space.

Parameters
ThisA pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL
WidthSignifies the width of the memory operation.
AddressThe address within the PCI configuration space for the PCI controller.
CountThe number of PCI configuration operations to perform.
BufferThe source buffer to get the results.
Return values
EFI_SUCCESSThe data was written to the PCI root bridge.
EFI_INVALID_PARAMETERInvalid parameters found.

Definition at line 1297 of file PciRootBridgeIo.c.

◆ RootBridgeIoPollIo()

EFI_STATUS EFIAPI RootBridgeIoPollIo ( IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL This,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH  Width,
IN UINT64  Address,
IN UINT64  Mask,
IN UINT64  Value,
IN UINT64  Delay,
OUT UINT64 *  Result 
)

Poll an address in I/O space until an exit condition is met or a timeout occurs.

Parameters
This- Pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instance.
Width- Width of I/O operation.
Address- The base address of the I/O operation.
Mask- Mask used for polling criteria.
Value- Comparison value used for polling exit criteria.
Delay- Number of 100ns units to poll.
Result- Pointer to the last value read from memory location.
Return values
EFI_SUCCESS- Success.
EFI_INVALID_PARAMETER- Invalid parameter found.
EFI_TIMEOUT- Delay expired before a match occurred.
EFI_OUT_OF_RESOURCES- Fail due to lack of resources.

Reads from the I/O space of a PCI Root Bridge. Returns when either the polling exit criteria is satisfied or after a defined duration.

This function provides a standard way to poll a PCI I/O location. A PCI I/O read operation is performed at the PCI I/O address specified by Address for the width specified by Width. The result of this PCI I/O read operation is stored in Result. This PCI I/O read operation is repeated until either a timeout of Delay 100 ns units has expired, or (Result & Mask) is equal to Value.

Parameters
[in]ThisA pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
[in]WidthSignifies the width of the I/O operations.
[in]AddressThe base address of the I/O operations. The caller is responsible for aligning Address if required.
[in]MaskMask used for the polling criteria. Bytes above Width in Mask are ignored. The bits in the bytes below Width which are zero in Mask are ignored when polling the I/O address.
[in]ValueThe comparison value used for the polling exit criteria.
[in]DelayThe number of 100 ns units to poll. Note that timer available may be of poorer granularity.
[out]ResultPointer to the last value read from the memory location.
Return values
EFI_SUCCESSThe last data returned from the access matched the poll exit criteria.
EFI_INVALID_PARAMETERWidth is invalid.
EFI_INVALID_PARAMETERResult is NULL.
EFI_TIMEOUTDelay expired before a match occurred.
EFI_OUT_OF_RESOURCESThe request could not be completed due to a lack of resources.

Definition at line 740 of file PciRootBridgeIo.c.

◆ RootBridgeIoPollMem()

EFI_STATUS EFIAPI RootBridgeIoPollMem ( IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL This,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH  Width,
IN UINT64  Address,
IN UINT64  Mask,
IN UINT64  Value,
IN UINT64  Delay,
OUT UINT64 *  Result 
)

Poll an address in memory mapped space until an exit condition is met or a timeout occurs.

Parameters
This- Pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instance.
Width- Width of the memory operation.
Address- The base address of the memory operation.
Mask- Mask used for polling criteria.
Value- Comparison value used for polling exit criteria.
Delay- Number of 100ns units to poll.
Result- Pointer to the last value read from memory location.
Return values
EFI_SUCCESS- Success.
EFI_INVALID_PARAMETER- Invalid parameter found.
EFI_TIMEOUT- Delay expired before a match occurred.
EFI_OUT_OF_RESOURCES- Fail due to lack of resources.

Polls an address in memory mapped I/O space until an exit condition is met, or a timeout occurs.

This function provides a standard way to poll a PCI memory location. A PCI memory read operation is performed at the PCI memory address specified by Address for the width specified by Width. The result of this PCI memory read operation is stored in Result. This PCI memory read operation is repeated until either a timeout of Delay 100 ns units has expired, or (Result & Mask) is equal to Value.

Parameters
[in]ThisA pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
[in]WidthSignifies the width of the memory operations.
[in]AddressThe base address of the memory operations. The caller is responsible for aligning Address if required.
[in]MaskMask used for the polling criteria. Bytes above Width in Mask are ignored. The bits in the bytes below Width which are zero in Mask are ignored when polling the memory address.
[in]ValueThe comparison value used for the polling exit criteria.
[in]DelayThe number of 100 ns units to poll. Note that timer available may be of poorer granularity.
[out]ResultPointer to the last value read from the memory location.
Return values
EFI_SUCCESSThe last data returned from the access matched the poll exit criteria.
EFI_INVALID_PARAMETERWidth is invalid.
EFI_INVALID_PARAMETERResult is NULL.
EFI_TIMEOUTDelay expired before a match occurred.
EFI_OUT_OF_RESOURCESThe request could not be completed due to a lack of resources.

Definition at line 636 of file PciRootBridgeIo.c.

◆ RootBridgeIoSetAttributes()

EFI_STATUS EFIAPI RootBridgeIoSetAttributes ( IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL This,
IN UINT64  Attributes,
IN OUT UINT64 *  ResourceBase,
IN OUT UINT64 *  ResourceLength 
)

Sets the attributes for a resource range on a PCI root bridge.

Parameters
This- Pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instance.
Attributes- The mask of attributes to set.
ResourceBase- Pointer to the base address of the resource range to be modified by the attributes specified by Attributes.
ResourceLength- Pointer to the length of the resource range to be modified.
Return values
EFI_SUCCESS- Success.
EFI_INVALID_PARAMETER- Invalid parameter found.
EFI_OUT_OF_RESOURCES- Not enough resources to set the attributes upon.

Sets attributes for a resource range on a PCI root bridge.

The SetAttributes() function sets the attributes specified in Attributes for the PCI root bridge on the resource range specified by ResourceBase and ResourceLength. Since the granularity of setting these attributes may vary from resource type to resource type, and from platform to platform, the actual resource range and the one passed in by the caller may differ. As a result, this function may set the attributes specified by Attributes on a larger resource range than the caller requested. The actual range is returned in ResourceBase and ResourceLength. The caller is responsible for verifying that the actual range for which the attributes were set is acceptable.

Parameters
ThisA pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
AttributesThe mask of attributes to set. If the attribute bit MEMORY_WRITE_COMBINE, MEMORY_CACHED, or MEMORY_DISABLE is set, then the resource range is specified by ResourceBase and ResourceLength. If MEMORY_WRITE_COMBINE, MEMORY_CACHED, and MEMORY_DISABLE are not set, then ResourceBase and ResourceLength are ignored, and may be NULL.
ResourceBaseA pointer to the base address of the resource range to be modified by the attributes specified by Attributes.
ResourceLengthA pointer to the length of the resource range to be modified by the attributes specified by Attributes.
Return values
EFI_SUCCESSThe current configuration of this PCI root bridge was returned in Resources.
EFI_UNSUPPORTEDThe current configuration of this PCI root bridge could not be retrieved.

Definition at line 1836 of file PciRootBridgeIo.c.

◆ RootBridgeIoUnmap()

EFI_STATUS EFIAPI RootBridgeIoUnmap ( IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL This,
IN VOID *  Mapping 
)

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

The Unmap() function completes the Map() operation and releases any corresponding resources. If the operation was an EfiPciOperationBusMasterWrite or EfiPciOperationBusMasterWrite64, the data is committed to the target system memory. Any resources used for the mapping are freed.

Parameters
[in]ThisA pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
[in]MappingThe mapping value returned from Map().
Return values
EFI_SUCCESSThe range was unmapped.
EFI_INVALID_PARAMETERMapping is not a value that was returned by Map().
EFI_DEVICE_ERRORThe data was not committed to the target system memory.

Definition at line 1497 of file PciRootBridgeIo.c.

Variable Documentation

◆ mCpuIo

EFI_CPU_IO2_PROTOCOL* mCpuIo
extern

Definition at line 14 of file PciHostBridge.c.