/// Define table for mapping PCI Segment MMIO physical addresses to virtual addresses at OS runtime\r
///\r
typedef struct {\r
- UINTN PhysicalAddress;\r
- UINTN VirtualAddress;\r
+ UINTN PhysicalAddress;\r
+ UINTN VirtualAddress;\r
} PCI_SEGMENT_RUNTIME_REGISTRATION_TABLE;\r
\r
///\r
/// Set Virtual Address Map Event\r
///\r
-EFI_EVENT mDxeRuntimePciSegmentLibVirtualNotifyEvent = NULL;\r
+EFI_EVENT mDxeRuntimePciSegmentLibVirtualNotifyEvent = NULL;\r
\r
///\r
/// The number of PCI devices that have been registered for runtime access.\r
///\r
-UINTN mDxeRuntimePciSegmentLibNumberOfRuntimeRanges = 0;\r
+UINTN mDxeRuntimePciSegmentLibNumberOfRuntimeRanges = 0;\r
\r
///\r
/// The table of PCI devices that have been registered for runtime access.\r
///\r
/// The table index of the most recent virtual address lookup.\r
///\r
-UINTN mDxeRuntimePciSegmentLibLastRuntimeRange = 0;\r
+UINTN mDxeRuntimePciSegmentLibLastRuntimeRange = 0;\r
\r
/**\r
Convert the physical PCI Express MMIO addresses for all registered PCI devices\r
IN VOID *Context\r
)\r
{\r
- UINTN Index;\r
- EFI_STATUS Status;\r
+ UINTN Index;\r
+ EFI_STATUS Status;\r
\r
//\r
// If there have been no runtime registrations, then just return\r
// virtual addresses.\r
//\r
for (Index = 0; Index < mDxeRuntimePciSegmentLibNumberOfRuntimeRanges; Index++) {\r
- Status = EfiConvertPointer (0, (VOID **) &(mDxeRuntimePciSegmentLibRegistrationTable[Index].VirtualAddress));\r
+ Status = EfiConvertPointer (0, (VOID **)&(mDxeRuntimePciSegmentLibRegistrationTable[Index].VirtualAddress));\r
ASSERT_EFI_ERROR (Status);\r
}\r
\r
//\r
// Convert table pointer that is allocated from EfiRuntimeServicesData to a virtual address.\r
//\r
- Status = EfiConvertPointer (0, (VOID **) &mDxeRuntimePciSegmentLibRegistrationTable);\r
+ Status = EfiConvertPointer (0, (VOID **)&mDxeRuntimePciSegmentLibRegistrationTable);\r
ASSERT_EFI_ERROR (Status);\r
}\r
\r
//\r
// Register SetVirtualAddressMap () notify function\r
//\r
- Status = gBS->CreateEventEx (\r
- EVT_NOTIFY_SIGNAL,\r
+ Status = gBS->CreateEvent (\r
+ EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,\r
TPL_NOTIFY,\r
DxeRuntimePciSegmentLibVirtualNotify,\r
NULL,\r
- &gEfiEventVirtualAddressChangeGuid,\r
&mDxeRuntimePciSegmentLibVirtualNotifyEvent\r
);\r
ASSERT_EFI_ERROR (Status);\r
// Convert Address to a ECAM address at the beginning of the PCI Configuration\r
// header for the specified PCI Bus/Dev/Func\r
//\r
- Address &= ~(UINTN)EFI_PAGE_MASK;\r
+ Address &= ~(UINTN)EFI_PAGE_MASK;\r
SegmentInfo = GetPciSegmentInfo (&Count);\r
EcamAddress = PciSegmentLibGetEcamAddress (Address, SegmentInfo, Count);\r
\r
if (EfiAtRuntime ()) {\r
return RETURN_UNSUPPORTED;\r
}\r
+\r
if (sizeof (UINTN) == sizeof (UINT32)) {\r
ASSERT (EcamAddress < BASE_4GB);\r
}\r
+\r
Address = (UINTN)EcamAddress;\r
\r
//\r
- // See if Address has already been registerd for runtime access\r
+ // See if Address has already been registered for runtime access\r
//\r
for (Index = 0; Index < mDxeRuntimePciSegmentLibNumberOfRuntimeRanges; Index++) {\r
if (mDxeRuntimePciSegmentLibRegistrationTable[Index].PhysicalAddress == Address) {\r
if (NewTable == NULL) {\r
return RETURN_OUT_OF_RESOURCES;\r
}\r
- mDxeRuntimePciSegmentLibRegistrationTable = NewTable;\r
+\r
+ mDxeRuntimePciSegmentLibRegistrationTable = NewTable;\r
mDxeRuntimePciSegmentLibRegistrationTable[mDxeRuntimePciSegmentLibNumberOfRuntimeRanges].PhysicalAddress = Address;\r
mDxeRuntimePciSegmentLibRegistrationTable[mDxeRuntimePciSegmentLibNumberOfRuntimeRanges].VirtualAddress = Address;\r
mDxeRuntimePciSegmentLibNumberOfRuntimeRanges++;\r
**/\r
UINTN\r
PciSegmentLibVirtualAddress (\r
- IN UINTN Address\r
+ IN UINTN Address\r
)\r
{\r
- UINTN Index;\r
+ UINTN Index;\r
+\r
//\r
// If SetVirtualAddressMap() has not been called, then just return the physical address\r
//\r