]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
Update INF file to properly declare which PCDs must be Fixed, and update PCD usage...
[mirror_edk2.git] / MdeModulePkg / Core / Pei / PeiMain / PeiMain.c
index 6e032783d0bdd88142cd5d52be38993a54b47647..3eb9b7f543fa6850929f1c4615c9a6f082f2ea69 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Pei Core Main Entry Point\r
   \r
-Copyright (c) 2006, Intel Corporation\r
+Copyright (c) 2006 - 2010, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#include <PeiMain.h>\r
+#include "PeiMain.h"\r
 \r
-STATIC EFI_PEI_PPI_DESCRIPTOR mMemoryDiscoveredPpi = {\r
+EFI_PEI_PPI_DESCRIPTOR mMemoryDiscoveredPpi = {\r
   (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
   &gEfiPeiMemoryDiscoveredPpiGuid,\r
   NULL\r
@@ -23,7 +23,7 @@ STATIC EFI_PEI_PPI_DESCRIPTOR mMemoryDiscoveredPpi = {
 ///\r
 /// Pei service instance\r
 ///\r
-STATIC EFI_PEI_SERVICES  gPs = {\r
+EFI_PEI_SERVICES  gPs = {\r
   {\r
     PEI_SERVICES_SIGNATURE,\r
     PEI_SERVICES_REVISION,\r
@@ -42,7 +42,7 @@ STATIC EFI_PEI_SERVICES  gPs = {
   PeiGetHobList,\r
   PeiCreateHob,\r
 \r
-  PeiFvFindNextVolume,\r
+  PeiFfsFindNextVolume,\r
   PeiFfsFindNextFile,\r
   PeiFfsFindSectionData,\r
 \r
@@ -55,8 +55,8 @@ STATIC EFI_PEI_SERVICES  gPs = {
   PeiReportStatusCode,\r
   PeiResetSystem,\r
 \r
-  NULL,\r
-  NULL,\r
+  &gPeiDefaultCpuIoPpi,\r
+  &gPeiDefaultPciCfg2Ppi,\r
 \r
   PeiFfsFindFileByName,\r
   PeiFfsGetFileInfo,\r
@@ -65,7 +65,6 @@ STATIC EFI_PEI_SERVICES  gPs = {
 };\r
 \r
 /**\r
-\r
   This routine is invoked by main entry of PeiMain module during transition\r
   from SEC to PEI. After switching stack in the PEI core, it will restart\r
   with the old core data.\r
@@ -83,10 +82,8 @@ STATIC EFI_PEI_SERVICES  gPs = {
                          core's data areas.\r
                          If NULL, it is first PeiCore entering.\r
 \r
-  @retval EFI_NOT_FOUND  Never reach\r
-\r
 **/\r
-EFI_STATUS\r
+VOID\r
 EFIAPI\r
 PeiCore (\r
   IN CONST EFI_SEC_PEI_HAND_OFF        *SecCoreData,\r
@@ -156,7 +153,7 @@ PeiCore (
   //\r
   // Initialize libraries that the PeiCore is linked against\r
   //\r
-  ProcessLibraryConstructorList (NULL, &PrivateData.PS);\r
+  ProcessLibraryConstructorList (NULL, (CONST EFI_PEI_SERVICES **)&PrivateData.PS);\r
 \r
   InitializeMemoryServices (&PrivateData, SecCoreData, OldCoreData);\r
 \r
@@ -165,7 +162,7 @@ PeiCore (
   //\r
   // Save PeiServicePointer so that it can be retrieved anywhere.\r
   //\r
-  SetPeiServicesTablePointer(&PrivateData.PS);\r
+  SetPeiServicesTablePointer((CONST EFI_PEI_SERVICES **) &PrivateData.PS);\r
   \r
   if (OldCoreData != NULL) {\r
 \r
@@ -187,8 +184,11 @@ PeiCore (
     //\r
     REPORT_STATUS_CODE (\r
       EFI_PROGRESS_CODE,\r
-      FixedPcdGet32 (PcdStatusCodeValuePeiCoreEntry)\r
+      PcdGet32 (PcdStatusCodeValuePeiCoreEntry)\r
       );\r
+      \r
+    PERF_START (NULL, "SEC", NULL, 1);\r
+    PERF_END (NULL, "SEC", NULL, Tick);\r
 \r
     PERF_START (NULL,"PEI", NULL, Tick);\r
     //\r
@@ -247,10 +247,11 @@ PeiCore (
                              &PrivateData.PS,\r
                              PrivateData.HobList\r
                              );\r
-\r
+  //\r
+  // Should never reach here.\r
+  //\r
   ASSERT_EFI_ERROR (Status);\r
-\r
-  return EFI_NOT_FOUND;\r
+  CpuDeadLoop();\r
 }\r
 \r
 \r