]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Core/Pei/PeiMain.h
1. Added Non-existing.c in BaseLib to assert no invocations of SwitchStack() on IPF.
[mirror_edk2.git] / EdkModulePkg / Core / Pei / PeiMain.h
index 95555138e282d7479be3806cb3240019e9635b2e..dc7185899bbc7be7f3ad755b535614d4068270b9 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, 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
@@ -138,7 +138,7 @@ PeiCore (
 \r
 Routine Description:\r
 \r
-  Main entry point to Pei Core. After switching stack in the PEI core, \r
+  Main entry point to Pei Core. After switching stack in the PEI core,\r
   it will restart with the old core data.\r
 \r
 Arguments:\r
@@ -180,10 +180,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 +222,7 @@ Returns:
 \r
   EFI_SUCCESS   - Successfully dispatched PEIM.\r
   EFI_NOT_FOUND - The dispatch failed.\r
-            \r
+\r
 --*/\r
 ;\r
 \r
@@ -273,7 +273,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
@@ -375,9 +375,9 @@ Routine Description:
 Arguments:\r
 \r
   CoreData   - The PEI core Private Data\r
-  \r
+\r
 Returns:\r
-        \r
+\r
 --*/\r
 ;\r
 \r
@@ -432,7 +432,7 @@ Arguments:
   NewHandOffHob - The new handoff HOB list.\r
 \r
 Returns:\r
-            \r
+\r
 --*/\r
 ;\r
 \r
@@ -518,7 +518,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 +610,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 +635,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 +744,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 +775,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 +825,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 +895,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 +955,7 @@ Arguments:
 Returns:\r
 \r
   Status  - EFI_SUCCESS\r
-            \r
+\r
 --*/\r
 ;\r
 \r
@@ -971,7 +971,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 +1004,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 +1019,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 +1038,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 +1070,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 +1109,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