]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Core/Pei/PeiMain.h
Remove autogen.h from all dxs files, because autogen.h file has been included by...
[mirror_edk2.git] / EdkModulePkg / Core / Pei / PeiMain.h
index 95555138e282d7479be3806cb3240019e9635b2e..82121ac043612a19a519c1ea0bad8efa6640c645 100644 (file)
@@ -1,13 +1,13 @@
 /*++\r
 \r
-Copyright (c) 2006, 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
-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 - 2007, 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
+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
 \r
 Module Name:\r
 \r
@@ -24,15 +24,7 @@ Revision History
 #ifndef _PEI_MAIN_H_\r
 #define _PEI_MAIN_H_\r
 \r
-#ifdef EFI64\r
-#include "SalApi.h"\r
-#endif\r
-\r
-//\r
-//Build private HOB to PEI core to transfer old NEM-range data to new NEM-range\r
-//\r
-#define EFI_PEI_CORE_PRIVATE_GUID  \\r
-  {0xd641a0f5, 0xcb7c, 0x4846, { 0xa3, 0x80, 0x1d, 0x01, 0xb4, 0xd9, 0xe3, 0xb9 } }\r
+extern EFI_GUID gEfiPeiCorePrivateGuid;\r
 \r
 //\r
 // Pei Core private data structures\r
@@ -125,21 +117,21 @@ typedef union {
 \r
 \r
 //\r
-// Main PEI entry\r
+// PeiCore function\r
 //\r
-\r
 EFI_STATUS\r
 EFIAPI\r
 PeiCore (\r
   IN EFI_PEI_STARTUP_DESCRIPTOR  *PeiStartupDescriptor,\r
-  IN PEI_CORE_INSTANCE           *OldCoreData\r
+  IN VOID                        *Data\r
   )\r
 /*++\r
 \r
 Routine Description:\r
 \r
-  Main entry point to Pei Core. After switching stack in the PEI core, \r
-  it will restart with the old core data.\r
+  The entry routine to Pei Core, invoked by PeiMain during transition\r
+  from SEC to PEI. After switching stack in the PEI core, it will restart\r
+  with the old core data.\r
 \r
 Arguments:\r
 \r
@@ -150,11 +142,11 @@ Arguments:
 Returns:\r
 \r
   This function never returns\r
+  EFI_NOT_FOUND        - Never reach\r
 \r
 --*/\r
 ;\r
 \r
-\r
 //\r
 // Dispatcher support functions\r
 //\r
@@ -180,10 +172,10 @@ Arguments:
 \r
   PeiServices               - Calling context.\r
 \r
-  DependencyExpression      - Pointer to a dependency expression.  The Grammar adheres to \r
+  DependencyExpression      - Pointer to a dependency expression.  The Grammar adheres to\r
                               the BNF described above and is stored in postfix notation.\r
-  Runnable                  - is True if the driver can be scheduled and False if the driver \r
-                              cannot be scheduled.  This is the value that the schedulers \r
+  Runnable                  - is True if the driver can be scheduled and False if the driver\r
+                              cannot be scheduled.  This is the value that the schedulers\r
                               should use for deciding the state of the driver.\r
 \r
 Returns:\r
@@ -222,7 +214,7 @@ Returns:
 \r
   EFI_SUCCESS   - Successfully dispatched PEIM.\r
   EFI_NOT_FOUND - The dispatch failed.\r
-            \r
+\r
 --*/\r
 ;\r
 \r
@@ -273,7 +265,7 @@ Arguments:
 \r
     FwVolHeader - Pointer to the FV header of the volume to search.\r
                      This parameter must point to a valid FFS volume.\r
-                     \r
+\r
     PeimFileHeader  - Pointer to the current file from which to begin searching.\r
                   This pointer will be updated upon return to reflect the file found.\r
 \r
@@ -355,7 +347,7 @@ Returns:
 --*/\r
 ;\r
 \r
-#ifdef EFI64\r
+#if   defined (MDE_CPU_IPF)\r
   //\r
   // In Ipf we should make special changes for the PHIT pointers to support\r
   // recovery boot in cache mode.\r
@@ -375,9 +367,9 @@ Routine Description:
 Arguments:\r
 \r
   CoreData   - The PEI core Private Data\r
-  \r
+\r
 Returns:\r
-        \r
+\r
 --*/\r
 ;\r
 \r
@@ -432,7 +424,7 @@ Arguments:
   NewHandOffHob - The new handoff HOB list.\r
 \r
 Returns:\r
-            \r
+\r
 --*/\r
 ;\r
 \r
@@ -518,7 +510,7 @@ Arguments:
 \r
 Returns:\r
 \r
-  Status -  EFI_SUCCESS   if the PPI is in the database           \r
+  Status -  EFI_SUCCESS   if the PPI is in the database\r
             EFI_NOT_FOUND if the PPI is not in the database\r
 --*/\r
 ;\r
@@ -610,12 +602,12 @@ PeiGetBootMode (
 \r
 Routine Description:\r
 \r
-  This service enables PEIMs to ascertain the present value of the boot mode.  \r
+  This service enables PEIMs to ascertain the present value of the boot mode.\r
 \r
 Arguments:\r
 \r
   PeiServices    - The PEI core services table.\r
-  BootMode       - A pointer to contain the value of the boot mode. \r
+  BootMode       - A pointer to contain the value of the boot mode.\r
 \r
 Returns:\r
 \r
@@ -635,7 +627,7 @@ PeiSetBootMode (
 \r
 Routine Description:\r
 \r
-  This service enables PEIMs to update the boot mode variable.    \r
+  This service enables PEIMs to update the boot mode variable.\r
 \r
 Arguments:\r
 \r
@@ -744,7 +736,7 @@ Returns:
   EFI_SUCCESS                 - Get the pointer of HOB List\r
   EFI_NOT_AVAILABLE_YET       - the HOB List is not yet published\r
   EFI_INVALID_PARAMETER       - HobList is NULL (in debug mode)\r
-            \r
+\r
 --*/\r
 ;\r
 \r
@@ -775,7 +767,7 @@ Returns:
           - EFI_INVALID_PARAMETER if Hob is NULL\r
           - EFI_NOT_AVAILABLE_YET if HobList is still not available.\r
           - EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.\r
-            \r
+\r
 --*/\r
 ;\r
 \r
@@ -825,16 +817,16 @@ Routine Description:
 \r
 Arguments:\r
     PeiServices - Pointer to the PEI Core Services Table.\r
-    \r
+\r
     SearchType - Filter to find only files of this type.\r
       Type EFI_FV_FILETYPE_ALL causes no filtering to be done.\r
-      \r
+\r
     FwVolHeader - Pointer to the FV header of the volume to search.\r
       This parameter must point to a valid FFS volume.\r
-      \r
+\r
     FileHeader  - Pointer to the current file from which to begin searching.\r
       This pointer will be updated upon return to reflect the file found.\r
-  \r
+\r
 Returns:\r
     EFI_NOT_FOUND - No files matching the search criteria were found\r
     EFI_SUCCESS\r
@@ -895,9 +887,9 @@ Arguments:
 \r
 Returns:\r
   Pointer to the Firmware Volume instance requested\r
-  \r
+\r
   EFI_INVALID_PARAMETER     - FwVolHeader is NULL\r
-  \r
+\r
   EFI_SUCCESS               - Firmware volume instance successfully found.\r
 \r
 --*/\r
@@ -955,7 +947,7 @@ Arguments:
 Returns:\r
 \r
   Status  - EFI_SUCCESS\r
-            \r
+\r
 --*/\r
 ;\r
 \r
@@ -971,7 +963,7 @@ PeiAllocatePages (
 \r
 Routine Description:\r
 \r
-  Memory allocation service on permanent memory, \r
+  Memory allocation service on permanent memory,\r
   not usable prior to the memory installation.\r
 \r
 Arguments:\r
@@ -1004,7 +996,7 @@ PeiAllocatePool (
 \r
 Routine Description:\r
 \r
-  Memory allocation service on the CAR.  \r
+  Memory allocation service on the CAR.\r
 \r
 Arguments:\r
 \r
@@ -1019,7 +1011,7 @@ Returns:
   Status - EFI_SUCCESS              The allocation was successful\r
            EFI_OUT_OF_RESOURCES     There is not enough heap to satisfy the requirement\r
                                     to allocate the requested size.\r
-                                    \r
+\r
 --*/\r
 ;\r
 \r
@@ -1038,15 +1030,15 @@ Routine Description:
 Arguments:\r
 \r
   PeiServices                 - Calling context.\r
-  \r
+\r
   PeimFileHeader              - Peim file's header.\r
-  \r
+\r
   EntryPoint                  - Entry point of that Peim file.\r
 \r
 Returns:\r
 \r
   Status code.\r
-            \r
+\r
 --*/\r
 ;\r
 \r
@@ -1070,15 +1062,15 @@ Routine Description:
 Arguments:\r
 \r
   PeiServices - The PEI core services table.\r
-  \r
+\r
   CodeType    - Type of Status Code.\r
-  \r
+\r
   Value       - Value to output for Status Code.\r
-  \r
+\r
   Instance    - Instance Number of this status code.\r
-  \r
+\r
   CallerId    - ID of the caller of this status code.\r
-  \r
+\r
   Data        - Optional data associated with this status code.\r
 \r
 Returns:\r
@@ -1109,10 +1101,42 @@ Returns:
 \r
   Status  - EFI_NOT_AVAILABLE_YET. PPI not available yet.\r
           - EFI_DEVICE_ERROR.   Did not reset system.\r
-          \r
-  Otherwise, resets the system. \r
+\r
+  Otherwise, resets the system.\r
 \r
 --*/\r
 ;\r
 \r
+/**\r
+  Transfers control to a function starting with a new stack.\r
+\r
+  Transfers control to the function specified by EntryPoint using the new stack\r
+  specified by NewStack and passing in the parameters specified by Context1 and\r
+  Context2. Context1 and Context2 are optional and may be NULL. The function\r
+  EntryPoint must never return.\r
+\r
+  If EntryPoint is NULL, then ASSERT().\r
+  If NewStack is NULL, then ASSERT().\r
+\r
+  @param  EntryPoint  A pointer to function to call with the new stack.\r
+  @param  Context1    A pointer to the context to pass into the EntryPoint\r
+                      function.\r
+  @param  Context2    A pointer to the context to pass into the EntryPoint\r
+                      function.\r
+  @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
+                      function.\r
+  @param  NewBsp      A pointer to the new BSP for the EntryPoint on IPF. It's\r
+                      Reserved on other architectures.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+PeiSwitchStacks (\r
+  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
+  IN      VOID                      *Context1,  OPTIONAL\r
+  IN      VOID                      *Context2,  OPTIONAL\r
+  IN      VOID                      *NewStack,\r
+  IN      VOID                      *NewBsp\r
+  );\r
+\r
 #endif\r