]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Core/Pei/PeiMain.h
Only include SAL related definitions if the CPU Arch is IPF
[mirror_edk2.git] / EdkModulePkg / Core / Pei / PeiMain.h
index 783fcd5867989c8c343df0a201f7629d74f1fdef..8f7c8e993b9c1b47144e42715b411855d9d8d6df 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
@@ -24,9 +24,9 @@ Revision History
 #ifndef _PEI_MAIN_H_\r
 #define _PEI_MAIN_H_\r
 \r
-#ifdef EFI64\r
-#include "SalApi.h"\r
-#endif\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
@@ -127,28 +127,6 @@ typedef union {
 //\r
 // Main PEI entry\r
 //\r
-EFI_STATUS\r
-EFIAPI\r
-PeiMain (\r
-  IN EFI_PEI_STARTUP_DESCRIPTOR  *PeiStartupDescriptor\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Main entry point to Pei Core.\r
-\r
-Arguments:\r
-\r
-  PeiStartupDescriptor - Information and services provided by SEC phase.\r
-\r
-Returns:\r
-\r
-  This function never returns\r
-\r
---*/\r
-;\r
-\r
 \r
 EFI_STATUS\r
 EFIAPI\r
@@ -160,9 +138,8 @@ PeiCore (
 \r
 Routine Description:\r
 \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
+  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
 \r
@@ -203,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
@@ -245,7 +222,7 @@ Returns:
 \r
   EFI_SUCCESS   - Successfully dispatched PEIM.\r
   EFI_NOT_FOUND - The dispatch failed.\r
-            \r
+\r
 --*/\r
 ;\r
 \r
@@ -296,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
@@ -398,9 +375,9 @@ Routine Description:
 Arguments:\r
 \r
   CoreData   - The PEI core Private Data\r
-  \r
+\r
 Returns:\r
-        \r
+\r
 --*/\r
 ;\r
 \r
@@ -455,7 +432,7 @@ Arguments:
   NewHandOffHob - The new handoff HOB list.\r
 \r
 Returns:\r
-            \r
+\r
 --*/\r
 ;\r
 \r
@@ -541,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
@@ -633,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
@@ -658,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
@@ -767,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
@@ -798,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
@@ -848,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
@@ -918,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
@@ -978,7 +955,7 @@ Arguments:
 Returns:\r
 \r
   Status  - EFI_SUCCESS\r
-            \r
+\r
 --*/\r
 ;\r
 \r
@@ -994,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
@@ -1027,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
@@ -1042,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
@@ -1061,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
@@ -1093,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
@@ -1132,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