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

Go to the source code of this file.

Data Structures

struct  PCI_SEGMENT_RUNTIME_REGISTRATION_TABLE
 

Functions

VOID EFIAPI DxeRuntimePciSegmentLibVirtualNotify (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS EFIAPI DxeRuntimePciSegmentLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS EFIAPI DxeRuntimePciSegmentLibDestructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
RETURN_STATUS EFIAPI PciSegmentRegisterForRuntimeAccess (IN UINTN Address)
 
UINTN PciSegmentLibVirtualAddress (IN UINTN Address)
 

Variables

EFI_EVENT mDxeRuntimePciSegmentLibVirtualNotifyEvent = NULL
 
UINTN mDxeRuntimePciSegmentLibNumberOfRuntimeRanges = 0
 
PCI_SEGMENT_RUNTIME_REGISTRATION_TABLEmDxeRuntimePciSegmentLibRegistrationTable = NULL
 
UINTN mDxeRuntimePciSegmentLibLastRuntimeRange = 0
 

Detailed Description

Instance of Runtime PCI Segment Library that support multi-segment PCI configuration access.

PCI Segment Library that consumes segment information provided by PciSegmentInfoLib to support multi-segment PCI configuration access through enhanced configuration access mechanism.

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

Definition in file DxeRuntimePciSegmentLib.c.

Function Documentation

◆ DxeRuntimePciSegmentLibConstructor()

EFI_STATUS EFIAPI DxeRuntimePciSegmentLibConstructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

The constructor function caches the PCI Express Base Address and creates a Set Virtual Address Map event to convert physical address to virtual addresses.

Parameters
ImageHandleThe firmware allocated handle for the EFI image.
SystemTableA pointer to the EFI System Table.
Return values
EFI_SUCCESSThe constructor completed successfully.
Othervalue The constructor did not complete successfully.

Definition at line 102 of file DxeRuntimePciSegmentLib.c.

◆ DxeRuntimePciSegmentLibDestructor()

EFI_STATUS EFIAPI DxeRuntimePciSegmentLibDestructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

The destructor function frees any allocated buffers and closes the Set Virtual Address Map event.

Parameters
ImageHandleThe firmware allocated handle for the EFI image.
SystemTableA pointer to the EFI System Table.
Return values
EFI_SUCCESSThe destructor completed successfully.
Othervalue The destructor did not complete successfully.

Definition at line 137 of file DxeRuntimePciSegmentLib.c.

◆ DxeRuntimePciSegmentLibVirtualNotify()

VOID EFIAPI DxeRuntimePciSegmentLibVirtualNotify ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Convert the physical PCI Express MMIO addresses for all registered PCI devices to virtual addresses.

Parameters
[in]EventThe event that is being processed.
[in]ContextThe Event Context.

Definition at line 58 of file DxeRuntimePciSegmentLib.c.

◆ PciSegmentLibVirtualAddress()

UINTN PciSegmentLibVirtualAddress ( IN UINTN  Address)

Return the linear address for the physical address.

Parameters
AddressThe physical address.
Return values
Thelinear address.

Definition at line 268 of file DxeRuntimePciSegmentLib.c.

◆ PciSegmentRegisterForRuntimeAccess()

RETURN_STATUS EFIAPI PciSegmentRegisterForRuntimeAccess ( IN UINTN  Address)

Register a PCI device so PCI configuration registers may be accessed after SetVirtualAddressMap().

If any reserved bits in Address are set, then ASSERT().

Parameters
AddressThe address that encodes the PCI Bus, Device, Function and Register.
Return values
RETURN_SUCCESSThe PCI device was registered for runtime access.
RETURN_UNSUPPORTEDAn attempt was made to call this function after ExitBootServices().
RETURN_UNSUPPORTEDThe resources required to access the PCI device at runtime could not be mapped.
RETURN_OUT_OF_RESOURCESThere are not enough resources available to complete the registration.

Definition at line 181 of file DxeRuntimePciSegmentLib.c.

Variable Documentation

◆ mDxeRuntimePciSegmentLibLastRuntimeRange

UINTN mDxeRuntimePciSegmentLibLastRuntimeRange = 0

The table index of the most recent virtual address lookup.

Definition at line 47 of file DxeRuntimePciSegmentLib.c.

◆ mDxeRuntimePciSegmentLibNumberOfRuntimeRanges

UINTN mDxeRuntimePciSegmentLibNumberOfRuntimeRanges = 0

The number of PCI devices that have been registered for runtime access.

Definition at line 37 of file DxeRuntimePciSegmentLib.c.

◆ mDxeRuntimePciSegmentLibRegistrationTable

PCI_SEGMENT_RUNTIME_REGISTRATION_TABLE* mDxeRuntimePciSegmentLibRegistrationTable = NULL

The table of PCI devices that have been registered for runtime access.

Definition at line 42 of file DxeRuntimePciSegmentLib.c.

◆ mDxeRuntimePciSegmentLibVirtualNotifyEvent

EFI_EVENT mDxeRuntimePciSegmentLibVirtualNotifyEvent = NULL

Set Virtual Address Map Event

Definition at line 32 of file DxeRuntimePciSegmentLib.c.