EFI_RUNTIME_IMAGE_ENTRY *RuntimeImage;\r
LIST_ENTRY *Link;\r
EFI_PHYSICAL_ADDRESS VirtImageBase;\r
+ UINTN Index;\r
+ UINTN Index1;\r
+ UINTN Index2;\r
+ UINTN Index3;\r
+ EFI_CAPSULE_TABLE *CapsuleTable; \r
+ EFI_CAPSULE_INFO_TABLE *CapsuleInfoTable; \r
\r
//\r
// Can only switch to virtual addresses once the memory map is locked down,\r
// BugBug: PI requires System Configuration Tables Conversion.\r
// Currently, we do not implement it.\r
//\r
+ for (Index = 0; Index < gST->NumberOfTableEntries; Index++) {\r
+ //\r
+ // CapsuleInfoGuid in ConfigTable refers to an array of CapsuleGuid, it is information\r
+ // from which you can tell which vendorGuids in ConfigTable are related to CapsuleTable.\r
+ // Each CapsuleTable points to a array of capsules across a system reset. Then convert \r
+ // the array contents to make these capsules visiable in Runtime.\r
+ //\r
+\r
+ //\r
+ // Firstly, Get CapsulInfoGuid in ConfigTable, it points to CapsuleInfoTable, which\r
+ // gather all the installed capsules' guids.\r
+ //\r
+ if (CompareGuid (&gEfiCapsuleInfoGuid, &(gST->ConfigurationTable[Index].VendorGuid))) {\r
+ CapsuleInfoTable = gST->ConfigurationTable[Index].VendorTable;\r
+ //\r
+ // For each known CapsuleGuid in CapsuleInfoTable, loop the whole ConfigTable to\r
+ // find out this guid related to CapsuleTable.\r
+ //\r
+ for (Index1 = 0; Index1 < CapsuleInfoTable->CapsuleGuidNumber; Index1++) {\r
+ for (Index2 = 0; Index2 < gST->NumberOfTableEntries; Index2++) {\r
+ //\r
+ // Find out certain CapsuleTable, go through its contents array, and convert them.\r
+ //\r
+ if (CompareGuid (&CapsuleInfoTable->CapsuleGuidPtr[Index1], &(gST->ConfigurationTable[Index2].VendorGuid))) {\r
+ CapsuleTable = gST->ConfigurationTable[Index2].VendorTable;\r
+ for (Index3 = 0; Index3 < CapsuleTable->CapsuleArrayNumber; Index3++) {\r
+ RuntimeDriverConvertInternalPointer ((VOID **) &CapsuleTable->CapsulePtr[Index3]);\r
+ } \r
+ RuntimeDriverConvertInternalPointer ((VOID **) &(gST->ConfigurationTable[Index2].VendorTable));\r
+ }\r
+ }\r
+ }\r
+ break;\r
+ }\r
+ }\r
\r
//\r
// Convert the runtime fields of the EFI System Table and recompute the CRC-32\r