]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/PeiCoreEntryPoint.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Library / PeiCoreEntryPoint.h
index 76afc594cb8dcab147a573c054c50ec9c2e7528e..4077e061043f64b502141c778d9fd9625787cde5 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
-  Entry point to the PEI Core\r
+  Module entry point library for PEI core.\r
 \r
-Copyright (c) 2006, 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
@@ -16,29 +10,61 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define __MODULE_ENTRY_POINT_H__\r
 \r
 /**\r
-  Enrty point to PEI core.\r
-\r
-  @param  PeiStartupDescriptor Pointer of start up information.\r
\r
-  @return Status returned by entry points of core and drivers. \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 PEI\r
+                      core's operating environment, such as the size and location of\r
+                      temporary RAM, 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 a single\r
+                      descriptor with the end-tag EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST.\r
+                      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\r
+                      Foundation and any modules can leverage the associated service calls\r
+                      and/or code in these early PPIs.\r
 \r
 **/\r
-EFI_STATUS\r
+VOID\r
 EFIAPI\r
-_ModuleEntryPoint (\r
+_ModuleEntryPoint(\r
   IN CONST  EFI_SEC_PEI_HAND_OFF    *SecCoreData,\r
   IN CONST  EFI_PEI_PPI_DESCRIPTOR  *PpiList\r
   );\r
 \r
 /**\r
-  Wrapper of enrty point to PEI core.\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  PeiStartupDescriptor Pointer of start up information.\r
\r
-  @return Status returned by entry points of core and drivers. \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 a single\r
+                      descriptor with the end-tag EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST.\r
+                      As part of its initialization phase, the PEI Foundation will add these\r
+                      SEC-hosted PPIs to its PPI database such that both the PEI Foundation\r
+                      and any modules can leverage the associated service calls and/or code\r
+                      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
@@ -46,35 +72,61 @@ EfiMain (
   );\r
 \r
 /**\r
-  Call constructs for all libraries. Automatics Generated by tool.\r
-\r
-  @param  FfsHeader   Pointer to header of FFS.\r
-  @param  PeiServices Pointer to the PEI Services Table.\r
+  Autogenerated function that calls the library constructors for all of the module's\r
+  dependent libraries.\r
+\r
+  This function must be called by the PEI Core once an initial PEI Services Table has been established.\r
+  This function calls the set of library constructors for the set of library instances that a\r
+  module depends on.  This include library instances that a module depends on directly and library\r
+  instances that a module depends on indirectly through other libraries.\r
+  This function is autogenerated by build tools and those build tools are responsible for collecting\r
+  the set of library instances, determining which ones have constructors, and calling the library\r
+  constructors in the proper order based upon the dependencies of each of the library instances.\r
+  The PEI Core must call this function with a NULL FileHandle value as soon as the initial PEI\r
+  Services Table has been established.\r
+\r
+  @param  FileHandle   Handle of the file being invoked.\r
+  @param  PeiServices  Describes the list of possible PEI Services.\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 ProcessLibraryConstructorList (\r
-  IN EFI_FFS_FILE_HEADER  *FfsHeader,\r
-  IN EFI_PEI_SERVICES     **PeiServices\r
+  IN EFI_PEI_FILE_HANDLE        FileHandle,\r
+  IN CONST EFI_PEI_SERVICES     **PeiServices\r
   );\r
 \r
 \r
 /**\r
-  Call the list of driver entry points. Automatics Generated by tool.\r
+  Autogenerated function that calls a set of module entry points.\r
+\r
+  This function must be called by _ModuleEntryPoint().\r
+  This function calls the set of module entry points.\r
+  This function is autogenerated by build tools and those build tools are responsible\r
+  for collecting the module entry points and calling them in a specified order.\r
+\r
+  @param SecCoreData    Points to a data structure containing information about the PEI\r
+                        core's operating environment, such as the size and location of\r
+                        temporary RAM, 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 a single\r
+                        descriptor with the end-tag EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST.\r
+                        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\r
+                        Foundation and any modules can leverage the associated service calls\r
+                        and/or code in these early PPIs.\r
+  @param  Context       A pointer to a private context structure defined by the PEI Core\r
+                        implementation. The implementation of _ModuleEntryPoint() must set\r
+                        this parameter is NULL to indicate that this is the first PEI phase.\r
 \r
-  @param  PeiStartupDescriptor  Pointer to startup information .\r
-  @param  OldCoreData           Pointer to Original startup information.\r
-\r
-  @return Status returned by entry points of drivers.  \r
\r
 **/\r
-EFI_STATUS\r
+VOID\r
 EFIAPI\r
 ProcessModuleEntryPointList (\r
   IN CONST  EFI_SEC_PEI_HAND_OFF    *SecCoreData,\r
   IN CONST  EFI_PEI_PPI_DESCRIPTOR  *PpiList,\r
-  IN VOID                           *OldCoreData\r
+  IN VOID                           *Context\r
   );\r
 \r
 #endif\r