]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.c
MdePkg/DxeServicesLib: remove bogus cast
[mirror_edk2.git] / MdePkg / Library / PeiCoreEntryPoint / PeiCoreEntryPoint.c
index ab2a172399b006e892df460a819ec8539a0db2be..85dee7f52915f972d0a2b1a71abcb50eaaa2ab43 100644 (file)
@@ -1,87 +1,95 @@
 /** @file\r
   Entry point to a the PEI Core.\r
 \r
-Copyright (c) 2007, Intel Corporation<BR>\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
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
+\r
+#include <PiPei.h>\r
+\r
 //\r
-// Include common header file for this module.\r
+// The Library classes this module produced\r
 //\r
-#include "CommonHeader.h"\r
+#include <Library/PeiCoreEntryPoint.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/DebugLib.h>\r
 \r
 /**\r
-  Enrty point to PEI core.\r
-\r
-  @param SecCoreData    Points to a data structure containing\r
-                        information about the PEI core's\r
-                        operating environment, such as the size\r
-                        and location of temporary RAM, the stack\r
-                        location and the BFV location. The type\r
-                        EFI_SEC_PEI_HAND_OFF is\r
-\r
-  @param PpiList        Points to a list of one or more PPI\r
-                        descriptors to be installed initially by\r
-                        the PEI core. An empty PPI list consists\r
-                        of a single descriptor with the end-tag\r
-                        EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST.\r
-                        As part of its initialization phase, the\r
-                        PEI Foundation will add these SEC-hosted\r
-                        PPIs to its PPI database such that both\r
-                        the PEI Foundation and any modules can\r
-                        leverage the associated service calls\r
-                        and/or code in these early PPIs.\r
+  The entry point of PE/COFF Image for the PEI Core.\r
+\r
+  This function is the entry point for the PEI Foundation, which allows the SEC phase\r
+  to pass information about the stack, temporary RAM and the Boot Firmware Volume.\r
+  In addition, it also allows the SEC phase to pass services and data forward for use\r
+  during the PEI phase in the form of one or more PPIs.\r
+  There is no limit to the number of additional PPIs that can be passed from SEC into\r
+  the PEI Foundation. As part of its initialization phase, the PEI Foundation will add\r
+  these SEC-hosted PPIs to its PPI database such that both the PEI Foundation and any\r
+  modules can leverage the associated service calls and/or code in these early PPIs.\r
+  This function is required to call ProcessModuleEntryPointList() with the Context\r
+  parameter set to NULL.  ProcessModuleEntryPoint() is never expected to return.\r
+  The PEI Core is responsible for calling ProcessLibraryConstructorList() as soon as\r
+  the PEI Services Table and the file handle for the PEI Core itself have been established.\r
+  If ProcessModuleEntryPointList() returns, then ASSERT() and halt the system.\r
+\r
+  @param SecCoreData  Points to a data structure containing information about the\r
+                      PEI core's operating environment, such as the size and\r
+                      location of temporary RAM, the stack location and the BFV\r
+                      location.\r
+\r
+  @param PpiList      Points to a list of one or more PPI descriptors to be\r
+                      installed initially by the PEI core. An empty PPI list\r
+                      consists of a single descriptor with the end-tag\r
+                      EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST.\r
+                      As part of its initialization phase, the PEI Foundation will\r
+                      add these SEC-hosted PPIs to its PPI database, such that both\r
+                      the PEI Foundation and any modules can leverage the associated\r
+                      service calls and/or code in these early PPIs.\r
 \r
 **/\r
-EFI_STATUS\r
+VOID\r
 EFIAPI\r
-_ModuleEntryPoint (\r
-  IN CONST EFI_SEC_PEI_HAND_OFF    *SecCoreData,\r
-  IN CONST EFI_PEI_PPI_DESCRIPTOR  *PpiList\r
-  )\r
+_ModuleEntryPoint(\r
+  IN CONST  EFI_SEC_PEI_HAND_OFF    *SecCoreData,\r
+  IN CONST  EFI_PEI_PPI_DESCRIPTOR  *PpiList\r
+)\r
 {\r
+  ProcessModuleEntryPointList (SecCoreData, PpiList, NULL);\r
+\r
   //\r
-  // Call the PEI Core entry point\r
+  // Should never return\r
   //\r
-  return ProcessModuleEntryPointList (SecCoreData, PpiList, NULL);\r
+  ASSERT(FALSE);\r
+  CpuDeadLoop ();\r
 }\r
 \r
 \r
 /**\r
-  Wrapper of enrty point to PEI core.\r
-\r
-  @param SecCoreData    Points to a data structure containing\r
-                        information about the PEI core's\r
-                        operating environment, such as the size\r
-                        and location of temporary RAM, the stack\r
-                        location and the BFV location. The type\r
-                        EFI_SEC_PEI_HAND_OFF is\r
-\r
-  @param PpiList        Points to a list of one or more PPI\r
-                        descriptors to be installed initially by\r
-                        the PEI core. An empty PPI list consists\r
-                        of a single descriptor with the end-tag\r
-                        EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST.\r
-                        As part of its initialization phase, the\r
-                        PEI Foundation will add these SEC-hosted\r
-                        PPIs to its PPI database such that both\r
-                        the PEI Foundation and any modules can\r
-                        leverage the associated service calls\r
-                        and/or code in these early PPIs.\r
+  Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().\r
+\r
+  This function is required to call _ModuleEntryPoint() passing in SecCoreData and PpiList.\r
+\r
+  @param SecCoreData  Points to a data structure containing information about the PEI core's\r
+                      operating environment, such as the size and location of temporary RAM,\r
+                      the stack location and the BFV location.\r
+\r
+  @param PpiList      Points to a list of one or more PPI descriptors to be installed\r
+                      initially by the PEI core.  An empty PPI list consists of\r
+                      a single descriptor with the end-tag\r
+                      EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST.\r
+                      As part of its initialization phase, the PEI Foundation will\r
+                      add these SEC-hosted PPIs to its PPI database, such that both\r
+                      the PEI Foundationand any modules can leverage the associated\r
+                      service calls and/or code in these early PPIs.\r
 \r
 **/\r
-EFI_STATUS\r
+VOID\r
+EFIAPI\r
 EfiMain (\r
-  IN CONST EFI_SEC_PEI_HAND_OFF    *SecCoreData,\r
-  IN CONST EFI_PEI_PPI_DESCRIPTOR  *PpiList\r
+  IN CONST  EFI_SEC_PEI_HAND_OFF    *SecCoreData,\r
+  IN CONST  EFI_PEI_PPI_DESCRIPTOR  *PpiList\r
   )\r
 {\r
-  return _ModuleEntryPoint (SecCoreData, PpiList);\r
+  _ModuleEntryPoint (SecCoreData, PpiList);\r
 }\r