/** @file\r
-\r
+ EFI PEI Core dispatch services\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
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
- Dispatcher.c\r
-\r
-Abstract:\r
-\r
- EFI PEI Core dispatch services\r
-\r
-Revision History\r
-\r
**/\r
\r
#include <PeiMain.h>\r
\r
-//\r
-//CAR is filled with this initial value during SEC phase\r
-//\r
+///\r
+/// CAR is filled with this initial value during SEC phase\r
+///\r
#define INIT_CAR_VALUE 0x5AA55AA5\r
\r
typedef struct {\r
EFI_HANDLE Handle;\r
} PEIM_FILE_HANDLE_EXTENDED_DATA;\r
\r
-VOID\r
-DiscoverPeimsAndOrderWithApriori (\r
- IN PEI_CORE_INSTANCE *Private,\r
- IN EFI_PEI_FV_HANDLE VolumeHandle\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
\r
Discover all Peims and optional Apriori file in one FV. There is at most one\r
Apriori file in one FV.\r
\r
-Arguments:\r
\r
- Private - Pointer to the private data passed in from caller\r
- VolumeHandle - Fv handle.\r
-Returns:\r
+ @param Private - Pointer to the private data passed in from caller\r
+ @param VolumeHandle - Fv handle.\r
\r
- NONE\r
-\r
---*/\r
+**/\r
+VOID\r
+DiscoverPeimsAndOrderWithApriori (\r
+ IN PEI_CORE_INSTANCE *Private,\r
+ IN EFI_PEI_FV_HANDLE VolumeHandle\r
+ )\r
{\r
EFI_STATUS Status;\r
EFI_PEI_FV_HANDLE FileHandle;\r
\r
}\r
\r
+/**\r
+ Shadow PeiCore module from flash to installed memory.\r
+ \r
+ @param PeiServices Pointer to PeiService table\r
+ @param PrivateInMem PeiCore's private data structure\r
+\r
+**/\r
VOID*\r
ShadowPeiCore(\r
EFI_PEI_SERVICES **PeiServices,\r
return (VOID*) ((UINTN) EntryPoint + (UINTN) PeiCore - (UINTN) _ModuleEntryPoint);\r
}\r
\r
-VOID\r
-PeiDispatcher (\r
- IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,\r
- IN PEI_CORE_INSTANCE *Private\r
- )\r
-\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
Conduct PEIM dispatch.\r
\r
-Arguments:\r
-\r
- SecCoreData - Points to a data structure containing information about the PEI core's operating\r
+ @param SecCoreData Points to a data structure containing information about the PEI core's operating\r
environment, such as the size and location of temporary RAM, the stack location and\r
the BFV location.\r
- PrivateData - Pointer to the private data passed in from caller\r
- DispatchData - Pointer to PEI_CORE_DISPATCH_DATA data.\r
-\r
-Returns:\r
+ @param Private Pointer to the private data passed in from caller\r
\r
- EFI_SUCCESS - Successfully dispatched PEIM.\r
- EFI_NOT_FOUND - The dispatch failed.\r
+ @retval EFI_SUCCESS - Successfully dispatched PEIM.\r
+ @retval EFI_NOT_FOUND - The dispatch failed.\r
\r
---*/\r
+**/\r
+VOID\r
+PeiDispatcher (\r
+ IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,\r
+ IN PEI_CORE_INSTANCE *Private\r
+ )\r
{\r
EFI_STATUS Status;\r
UINT32 Index1;\r
\r
}\r
\r
-VOID\r
-InitializeDispatcherData (\r
- IN PEI_CORE_INSTANCE *PrivateData,\r
- IN PEI_CORE_INSTANCE *OldCoreData,\r
- IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
Initialize the Dispatcher's data members\r
\r
-Arguments:\r
-\r
- PeiServices - The PEI core services table.\r
- OldCoreData - Pointer to old core data (before switching stack).\r
+ @param PrivateData PeiCore's private data structure\r
+ @param OldCoreData Old data from SecCore\r
NULL if being run in non-permament memory mode.\r
- SecCoreData - Points to a data structure containing information about the PEI core's operating\r
+ @param SecCoreData Points to a data structure containing information about the PEI core's operating\r
environment, such as the size and location of temporary RAM, the stack location and\r
the BFV location.\r
\r
-Returns:\r
-\r
- None.\r
+ @return None.\r
\r
---*/\r
+**/\r
+VOID\r
+InitializeDispatcherData (\r
+ IN PEI_CORE_INSTANCE *PrivateData,\r
+ IN PEI_CORE_INSTANCE *OldCoreData,\r
+ IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData\r
+ )\r
{\r
if (OldCoreData == NULL) {\r
PeiInitializeFv (PrivateData, SecCoreData);\r
return;\r
}\r
\r
+/**\r
+ This routine parses the Dependency Expression, if available, and\r
+ decides if the module can be executed.\r
+\r
+\r
+ @param Private PeiCore's private data structure\r
+ @param FileHandle PEIM's file handle\r
+ @param PeimCount Peim count in all dispatched PEIMs.\r
\r
+ @retval TRUE Can be dispatched\r
+ @retval FALSE Cannot be dispatched\r
+\r
+**/\r
BOOLEAN\r
DepexSatisfied (\r
IN PEI_CORE_INSTANCE *Private,\r
IN EFI_PEI_FILE_HANDLE FileHandle,\r
IN UINTN PeimCount\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- This routine parses the Dependency Expression, if available, and\r
- decides if the module can be executed.\r
-\r
-Arguments:\r
- PeiServices - The PEI Service Table\r
- CurrentPeimAddress - Address of the PEIM Firmware File under investigation\r
-\r
-Returns:\r
- TRUE - Can be dispatched\r
- FALSE - Cannot be dispatched\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
VOID *DepexData;\r
This routine enable a PEIM to register itself to shadow when PEI Foundation\r
discovery permanent memory.\r
\r
- @param FileHandle File handle of a PEIM.\r
+ @param FileHandle File handle of a PEIM.\r
\r
- @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.\r
- @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.\r
- @retval EFI_SUCCESS Successfully to register itself.\r
+ @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.\r
+ @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.\r
+ @retval EFI_SUCCESS Successfully to register itself.\r
\r
**/\r
EFI_STATUS\r
return EFI_SUCCESS;\r
}\r
\r
-\r
-\r
/**\r
Get Fv image from the FV type file, then install FV INFO ppi, Build FV hob.\r
\r
- @param PeiServices Pointer to the PEI Core Services Table.\r
- @param FileHandle File handle of a Fv type file.\r
+ @param PeiServices Pointer to the PEI Core Services Table.\r
+ @param FvFileHandle File handle of a Fv type file.\r
@param AuthenticationState Pointer to attestation authentication state of image.\r
\r
\r
- @retval EFI_NOT_FOUND FV image can't be found.\r
- @retval EFI_SUCCESS Successfully to process it.\r
+ @retval EFI_NOT_FOUND FV image can't be found.\r
+ @retval EFI_SUCCESS Successfully to process it.\r
\r
**/\r
EFI_STATUS\r