a) Fixed the issue that the unnecessary build for not specified ARCH in single module...
[mirror_edk2.git] / EdkModulePkg / Core / DxeIplPeim / DxeLoad.c
index 78008412759d21419033611e5ad08e952a8ddd66..44923764627e75cf4867a7c43cbe096d790acae7 100644 (file)
@@ -470,12 +470,12 @@ Returns:
                &FfsFileHeader\r
                );\r
     if (!EFI_ERROR (Status)) {\r
-      CopyMem (FileName, &FfsFileHeader->Name, sizeof (EFI_GUID));\r
       Status = PeiProcessFile (\r
                  SectionType,\r
-                 FfsFileHeader,\r
+                 &FfsFileHeader,\r
                  Pe32Data\r
                  );\r
+      CopyMem (FileName, &FfsFileHeader->Name, sizeof (EFI_GUID));\r
       return Status;\r
     }\r
     Hob.Raw = GET_NEXT_HOB (Hob);\r
@@ -683,7 +683,7 @@ Returns:
   //\r
   Status = PeiProcessFile (\r
             EFI_SECTION_PE32,\r
-            FfsHeader,\r
+            &FfsHeader,\r
             &Pe32Data\r
             );\r
 \r
@@ -706,9 +706,9 @@ Returns:
 \r
 EFI_STATUS\r
 PeiProcessFile (\r
-  IN  UINT16                 SectionType,\r
-  IN  EFI_FFS_FILE_HEADER    *FfsFileHeader,\r
-  OUT VOID                   **Pe32Data\r
+  IN      UINT16                 SectionType,\r
+  IN OUT  EFI_FFS_FILE_HEADER    **RealFfsFileHeader,\r
+  OUT     VOID                   **Pe32Data\r
   )\r
 /*++\r
 \r
@@ -756,6 +756,9 @@ Returns:
   EFI_GUID                        TempGuid;\r
   EFI_FIRMWARE_VOLUME_HEADER      *FvHeader;\r
   EFI_COMPRESSION_SECTION         *CompressionSection;\r
+  EFI_FFS_FILE_HEADER             *FfsFileHeader;\r
+  \r
+  FfsFileHeader = *RealFfsFileHeader;\r
 \r
   Status = PeiServicesFfsFindSectionData (\r
              EFI_SECTION_COMPRESSION,\r
@@ -950,7 +953,11 @@ Returns:
               return EFI_NOT_FOUND;\r
             }\r
 \r
-            return PeiProcessFile (SectionType, FfsFileHeader, Pe32Data);\r
+            //\r
+            // Reture the FfsHeader that contain Pe32Data.\r
+            //\r
+            *RealFfsFileHeader = FfsFileHeader;\r
+            return PeiProcessFile (SectionType, RealFfsFileHeader, Pe32Data);\r
           }\r
         }\r
         //\r