]> git.proxmox.com Git - mirror_edk2.git/blobdiff - PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c
PrmPkg: Enable variable growth for the PRM_MODULE_EXPORT macro
[mirror_edk2.git] / PrmPkg / PrmLoaderDxe / PrmLoaderDxe.c
index 85fffdcbd9f1ba9ce79b155c43340f56e58845b2..5fda4c1b01daf38f784fe5f8391e80b3bd580f31 100644 (file)
@@ -122,7 +122,7 @@ GetPrmModuleExportDescriptorTable (
         return EFI_NOT_FOUND;\r
       }\r
       TempExportDescriptor = (PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT *) ((UINTN) CurrentImageAddress + ExportAddressTable[PrmModuleExportDescriptorOrdinal]);\r
-      if (TempExportDescriptor->Signature == PRM_MODULE_EXPORT_DESCRIPTOR_SIGNATURE) {\r
+      if (TempExportDescriptor->Header.Signature == PRM_MODULE_EXPORT_DESCRIPTOR_SIGNATURE) {\r
         *ExportDescriptor = TempExportDescriptor;\r
         DEBUG ((DEBUG_INFO, "  %a %a: PRM Module Export Descriptor found at 0x%x.\n", _DBGMSGID_, __FUNCTION__, (UINTN) ExportDescriptor));\r
       } else {\r
@@ -528,7 +528,7 @@ DiscoverPrmModules (
       sizeof (*(PrmModuleImageContextListEntry->Context))\r
       );\r
     InsertTailList (&mPrmModuleList, &PrmModuleImageContextListEntry->Link);\r
-    mPrmHandlerCount += TempPrmModuleImageContext.ExportDescriptor->NumberPrmHandlers;\r
+    mPrmHandlerCount += TempPrmModuleImageContext.ExportDescriptor->Header.NumberPrmHandlers;\r
     mPrmModuleCount++; // Todo: Match with global variable refactor change in the future\r
     DEBUG ((DEBUG_INFO, "%a %a: New PRM Module inserted into list to be processed.\n", _DBGMSGID_, __FUNCTION__));\r
   }\r
@@ -684,16 +684,16 @@ ProcessPrmModules (
       _DBGMSGID_,\r
       __FUNCTION__,\r
       (CHAR8 *) ((UINTN) CurrentImageAddress + CurrentImageExportDirectory->Name),\r
-      CurrentExportDescriptorStruct->NumberPrmHandlers\r
+      CurrentExportDescriptorStruct->Header.NumberPrmHandlers\r
       ));\r
 \r
     CurrentModuleInfoStruct->StructureRevision = PRM_MODULE_INFORMATION_STRUCT_REVISION;\r
     CurrentModuleInfoStruct->StructureLength = (\r
                                              OFFSET_OF (PRM_MODULE_INFORMATION_STRUCT, HandlerInfoStructure) +\r
-                                             (CurrentExportDescriptorStruct->NumberPrmHandlers * sizeof (PRM_HANDLER_INFORMATION_STRUCT))\r
+                                             (CurrentExportDescriptorStruct->Header.NumberPrmHandlers * sizeof (PRM_HANDLER_INFORMATION_STRUCT))\r
                                              );\r
-    CopyGuid (&CurrentModuleInfoStruct->Identifier, &CurrentExportDescriptorStruct->ModuleGuid);\r
-    CurrentModuleInfoStruct->HandlerCount       = (UINT32) CurrentExportDescriptorStruct->NumberPrmHandlers;\r
+    CopyGuid (&CurrentModuleInfoStruct->Identifier, &CurrentExportDescriptorStruct->Header.ModuleGuid);\r
+    CurrentModuleInfoStruct->HandlerCount       = (UINT32) CurrentExportDescriptorStruct->Header.NumberPrmHandlers;\r
     CurrentModuleInfoStruct->HandlerInfoOffset  = OFFSET_OF (PRM_MODULE_INFORMATION_STRUCT, HandlerInfoStructure);\r
 \r
     CurrentModuleInfoStruct->MajorRevision = 0;\r
@@ -737,7 +737,7 @@ ProcessPrmModules (
     //\r
     // Iterate across all PRM handlers in the PRM Module\r
     //\r
-    for (HandlerIndex = 0; HandlerIndex < CurrentExportDescriptorStruct->NumberPrmHandlers; HandlerIndex++) {\r
+    for (HandlerIndex = 0; HandlerIndex < CurrentExportDescriptorStruct->Header.NumberPrmHandlers; HandlerIndex++) {\r
       CurrentHandlerInfoStruct = &(CurrentModuleInfoStruct->HandlerInfoStructure[HandlerIndex]);\r
 \r
       CurrentHandlerInfoStruct->StructureRevision = PRM_HANDLER_INFORMATION_STRUCT_REVISION;\r