- @param PrivateData Pointer to PeiCore's private data structure.\r
- @param OldCheckingBottom Bottom of temporary memory range. All Ppi in this range\r
- will be fixup for PpiData and PpiDescriptor pointer.\r
- @param OldCheckingTop Top of temporary memory range. All Ppi in this range\r
- will be fixup for PpiData and PpiDescriptor.\r
- @param Fixup The address difference between\r
- the new Hob list and old Hob list.\r
+ @param PpiPointer Pointer to Ppi\r
+ @param TempBottom Base of old temporary memory\r
+ @param TempTop Top of old temporary memory\r
+ @param Offset Offset of new memory to old temporary memory.\r
+ @param OffsetPositive Positive flag of Offset value. \r
+\r
+**/\r
+VOID\r
+ConvertSinglePpiPointer (\r
+ IN PEI_PPI_LIST_POINTERS *PpiPointer,\r
+ IN UINTN TempBottom,\r
+ IN UINTN TempTop,\r
+ IN UINTN Offset,\r
+ IN BOOLEAN OffsetPositive\r
+ )\r
+{\r
+ if (((UINTN)PpiPointer->Raw < TempTop) &&\r
+ ((UINTN)PpiPointer->Raw >= TempBottom)) {\r
+ //\r
+ // Convert the pointer to the PPI descriptor from the old TempRam\r
+ // to the relocated physical memory.\r
+ //\r
+ if (OffsetPositive) {\r
+ PpiPointer->Raw = (VOID *) ((UINTN)PpiPointer->Raw + Offset);\r
+ } else {\r
+ PpiPointer->Raw = (VOID *) ((UINTN)PpiPointer->Raw - Offset);\r
+ }\r
+\r
+ //\r
+ // Only when the PEIM descriptor is in the old TempRam should it be necessary\r
+ // to try to convert the pointers in the PEIM descriptor\r
+ //\r
+\r
+ if (((UINTN)PpiPointer->Ppi->Guid < TempTop) &&\r
+ ((UINTN)PpiPointer->Ppi->Guid >= TempBottom)) {\r
+ //\r
+ // Convert the pointer to the GUID in the PPI or NOTIFY descriptor\r
+ // from the old TempRam to the relocated physical memory.\r
+ //\r
+ if (OffsetPositive) {\r
+ PpiPointer->Ppi->Guid = (VOID *) ((UINTN)PpiPointer->Ppi->Guid + Offset);\r
+ } else {\r
+ PpiPointer->Ppi->Guid = (VOID *) ((UINTN)PpiPointer->Ppi->Guid - Offset);\r
+ }\r
+ }\r
+\r
+ //\r
+ // Convert the pointer to the PPI interface structure in the PPI descriptor\r
+ // from the old TempRam to the relocated physical memory.\r
+ //\r
+ if ((UINTN)PpiPointer->Ppi->Ppi < TempTop &&\r
+ (UINTN)PpiPointer->Ppi->Ppi >= TempBottom) {\r
+ if (OffsetPositive) {\r
+ PpiPointer->Ppi->Ppi = (VOID *) ((UINTN)PpiPointer->Ppi->Ppi + Offset);\r
+ } else {\r
+ PpiPointer->Ppi->Ppi = (VOID *) ((UINTN)PpiPointer->Ppi->Ppi - Offset);\r
+ }\r
+ }\r
+ }\r
+}\r
+\r
+/**\r
+\r
+ Migrate PPI Pointers from the temporary memory stack to PEI installed memory.\r
+\r
+ @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size \r
+ and location of temporary RAM, the stack location and the BFV location.\r
+ @param PrivateData Pointer to PeiCore's private data structure.\r