]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
Update input of disasmembler to support IfThen construct. Add prototype dos script...
[mirror_edk2.git] / MdeModulePkg / Core / Pei / Dispatcher / Dispatcher.c
index c63bce8fd8afae409e6e8f8f7a9b307f6b1f66fc..bdbb00b205f86dcec674c108743fe5a830811168 100644 (file)
@@ -75,7 +75,7 @@ DiscoverPeimsAndOrderWithApriori (
   //\r
   // Go ahead to scan this Fv, and cache FileHandles within it.\r
   //\r
-  for (PeimCount = 0; PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv); PeimCount++) {\r
+  for (PeimCount = 0; PeimCount < PcdGet32 (PcdPeiCoreMaxPeimPerFv); PeimCount++) {\r
     Status = FvPpi->FindFileByType (FvPpi, PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE, CoreFileHandle->FvHandle, &FileHandle);\r
     if (Status != EFI_SUCCESS) {\r
       break;\r
@@ -88,7 +88,7 @@ DiscoverPeimsAndOrderWithApriori (
   // Check whether the count of Peims exceeds the max support PEIMs in a FV image\r
   // If more Peims are required in a FV image, PcdPeiCoreMaxPeimPerFv can be set to a larger value in DSC file.\r
   //\r
-  ASSERT (PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv));\r
+  ASSERT (PeimCount < PcdGet32 (PcdPeiCoreMaxPeimPerFv));\r
 \r
   //\r
   // Get Apriori File handle\r
@@ -221,6 +221,7 @@ ShadowPeiCore(
   Status = PeiLoadImage (\r
               PeiServices,\r
               *((EFI_PEI_FILE_HANDLE*)&PeiCoreFileHandle),\r
+              PEIM_STATE_REGISITER_FOR_SHADOW,\r
               &EntryPoint,\r
               &AuthenticationState\r
               );\r
@@ -292,12 +293,13 @@ PeiDispatcher (
     SaveCurrentFileHandle =  Private->CurrentFileHandle;\r
 \r
     for (Index1 = 0; Index1 <= SaveCurrentFvCount; Index1++) {\r
-      for (Index2 = 0; (Index2 < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->Fv[Index1].FvFileHandles[Index2] != NULL); Index2++) {\r
+      for (Index2 = 0; (Index2 < PcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->Fv[Index1].FvFileHandles[Index2] != NULL); Index2++) {\r
         if (Private->Fv[Index1].PeimState[Index2] == PEIM_STATE_REGISITER_FOR_SHADOW) {\r
           PeimFileHandle = Private->Fv[Index1].FvFileHandles[Index2];\r
           Status = PeiLoadImage (\r
                     (CONST EFI_PEI_SERVICES **) &Private->PS,\r
                     PeimFileHandle,\r
+                    PEIM_STATE_REGISITER_FOR_SHADOW,\r
                     &EntryPoint,\r
                     &AuthenticationState\r
                     );\r
@@ -314,9 +316,9 @@ PeiDispatcher (
             //\r
             PeimEntryPoint = (EFI_PEIM_ENTRY_POINT2)(UINTN)EntryPoint;\r
 \r
-            PERF_START (0, "PEIM", NULL, 0);\r
+            PERF_START (PeimFileHandle, "PEIM", NULL, 0);\r
             PeimEntryPoint(PeimFileHandle, (const EFI_PEI_SERVICES **) &Private->PS);\r
-            PERF_END (0, "PEIM", NULL, 0);\r
+            PERF_END (PeimFileHandle, "PEIM", NULL, 0);\r
           }\r
 \r
           //\r
@@ -377,7 +379,7 @@ PeiDispatcher (
       // Start to dispatch all modules within the current Fv.\r
       //\r
       for (PeimCount = Private->CurrentPeimCount;\r
-           (PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->CurrentFvFileHandles[PeimCount] != NULL);\r
+           (PeimCount < PcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->CurrentFvFileHandles[PeimCount] != NULL);\r
            PeimCount++) {\r
         Private->CurrentPeimCount  = PeimCount;\r
         PeimFileHandle = Private->CurrentFileHandle = Private->CurrentFvFileHandles[PeimCount];\r
@@ -401,6 +403,7 @@ PeiDispatcher (
               Status = PeiLoadImage (\r
                          PeiServices,\r
                          PeimFileHandle,\r
+                         PEIM_STATE_NOT_DISPATCHED,\r
                          &EntryPoint,\r
                          &AuthenticationState\r
                          );\r
@@ -411,13 +414,13 @@ PeiDispatcher (
               // The PEIM has its dependencies satisfied, and its entry point\r
               // has been found, so invoke it.\r
               //\r
-              PERF_START (0, "PEIM", NULL, 0);\r
+              PERF_START (PeimFileHandle, "PEIM", NULL, 0);\r
 \r
               ExtendedData.Handle = (EFI_HANDLE)PeimFileHandle;\r
 \r
               REPORT_STATUS_CODE_WITH_EXTENDED_DATA (\r
                 EFI_PROGRESS_CODE,\r
-                PcdGet32(PcdStatusCodeValuePeimDispatch),\r
+                (EFI_SOFTWARE_PEI_CORE | EFI_SW_PC_INIT_BEGIN),\r
                 (VOID *)(&ExtendedData),\r
                 sizeof (ExtendedData)\r
                 );\r
@@ -442,11 +445,11 @@ PeiDispatcher (
 \r
               REPORT_STATUS_CODE_WITH_EXTENDED_DATA (\r
                 EFI_PROGRESS_CODE,\r
-                PcdGet32(PcdStatusCodeValuePeimDispatch),\r
+                (EFI_SOFTWARE_PEI_CORE | EFI_SW_PC_INIT_BEGIN),\r
                 (VOID *)(&ExtendedData),\r
                 sizeof (ExtendedData)\r
                 );\r
-              PERF_END (0, "PEIM", NULL, 0);\r
+              PERF_END (PeimFileHandle, "PEIM", NULL, 0);\r
 \r
             }\r
 \r
@@ -820,3 +823,4 @@ PeiRegisterForShadow (
 }\r
 \r
 \r
+\r