From 797a9d6791a7529c20c7b10f2843e9f38ed5a6a5 Mon Sep 17 00:00:00 2001 From: klu2 Date: Mon, 10 Dec 2007 03:47:56 +0000 Subject: MdeModule cleanup for PI: 1) PeiMain: - Use PCD for bundle of status code which definitions are put into MdePkg.dec file. 2) DxeMain: - Use PCD for bundle of status code which definitions are put into MdePkg.dec file. - Do not produce SectionExtraction protocol which is belong to IntelFramework specification. - Update many macro for PI specifications. 3) DxeIpl - Use PCD for bundle of status code which definitions are put into MdePkg.dec file. 4) Add SectionExtractionDxe module (IntelFrameworkModulePkg) - This module will produce EFI_SECTION_EXTRACTION_PROTOCOL defined in framework specification. If a old platform want to use this protocol, then this platform need dispatch this DXE driver. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4376 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 27 +++++++++++++++------------ MdeModulePkg/Core/Pei/FwVol/FwVol.c | 4 ++-- MdeModulePkg/Core/Pei/PeiMain.h | 2 -- MdeModulePkg/Core/Pei/PeiMain.inf | 3 ++- MdeModulePkg/Core/Pei/PeiMain/PeiMain.c | 2 +- 5 files changed, 20 insertions(+), 18 deletions(-) (limited to 'MdeModulePkg/Core/Pei') diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c index 5a140ed7bd..73a6245b7e 100644 --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c @@ -23,6 +23,11 @@ Revision History #include +typedef struct { + EFI_STATUS_CODE_DATA DataHeader; + EFI_HANDLE Handle; +} PEIM_FILE_HANDLE_EXTENDED_DATA; + STATIC VOID InvokePeiCore ( @@ -223,7 +228,7 @@ Returns: UINTN PeimCount; UINT32 AuthenticationState; EFI_PHYSICAL_ADDRESS EntryPoint; - EFI_PEIM_ENTRY_POINT PeimEntryPoint; + EFI_PEIM_ENTRY_POINT2 PeimEntryPoint; BOOLEAN PeimNeedingDispatch; BOOLEAN PeimDispatchOnThisPass; UINTN SaveCurrentPeimCount; @@ -231,7 +236,7 @@ Returns: EFI_PEI_FILE_HANDLE SaveCurrentFileHandle; VOID *TopOfStack; PEI_CORE_PARAMETERS PeiCoreParameters; - EFI_DEVICE_HANDLE_EXTENDED_DATA ExtendedData; + PEIM_FILE_HANDLE_EXTENDED_DATA ExtendedData; EFI_FV_FILE_INFO FvFileInfo; @@ -270,10 +275,10 @@ Returns: // // Call the PEIM entry point // - PeimEntryPoint = (EFI_PEIM_ENTRY_POINT)(UINTN)EntryPoint; + PeimEntryPoint = (EFI_PEIM_ENTRY_POINT2)(UINTN)EntryPoint; PERF_START (0, "PEIM", NULL, 0); - PeimEntryPoint(PeimFileHandle, &Private->PS); + PeimEntryPoint(PeimFileHandle, (const EFI_PEI_SERVICES **) &Private->PS); PERF_END (0, "PEIM", NULL, 0); } @@ -357,7 +362,7 @@ Returns: REPORT_STATUS_CODE_WITH_EXTENDED_DATA ( EFI_PROGRESS_CODE, - EFI_SOFTWARE_PEI_CORE | EFI_SW_PC_INIT_BEGIN, + FixedPcdGet32(PcdStatusCodeValuePeimDispatch), (VOID *)(&ExtendedData), sizeof (ExtendedData) ); @@ -373,18 +378,16 @@ Returns: // // Call the PEIM entry point for PEIM driver // - PeimEntryPoint = (EFI_PEIM_ENTRY_POINT)(UINTN)EntryPoint; - PeimEntryPoint (PeimFileHandle, PeiServices); + PeimEntryPoint = (EFI_PEIM_ENTRY_POINT2)(UINTN)EntryPoint; + PeimEntryPoint (PeimFileHandle, (const EFI_PEI_SERVICES **) PeiServices); } - // - // One module has been dispatched. - // + PeimDispatchOnThisPass = TRUE; } REPORT_STATUS_CODE_WITH_EXTENDED_DATA ( EFI_PROGRESS_CODE, - EFI_SOFTWARE_PEI_CORE | EFI_SW_PC_INIT_END, + FixedPcdGet32(PcdStatusCodeValuePeimDispatch), (VOID *)(&ExtendedData), sizeof (ExtendedData) ); @@ -483,7 +486,7 @@ Returns: // We call the entry point a 2nd time so the module knows it's shadowed. // //PERF_START (PeiServices, L"PEIM", PeimFileHandle, 0); - PeimEntryPoint (PeimFileHandle, PeiServices); + PeimEntryPoint (PeimFileHandle, (const EFI_PEI_SERVICES **) PeiServices); //PERF_END (PeiServices, L"PEIM", PeimFileHandle, 0); // diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c b/MdeModulePkg/Core/Pei/FwVol/FwVol.c index 621fb16f18..358889213e 100644 --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c @@ -198,7 +198,7 @@ Returns: FileHeader = (EFI_FFS_FILE_HEADER **)FileHandle; FvLength = FwVolHeader->FvLength; - if (FwVolHeader->Attributes & EFI_FVB_ERASE_POLARITY) { + if (FwVolHeader->Attributes & EFI_FVB2_ERASE_POLARITY) { ErasePolarity = 1; } else { ErasePolarity = 0; @@ -781,7 +781,7 @@ Returns: return EFI_INVALID_PARAMETER; } - if (((EFI_FIRMWARE_VOLUME_HEADER*)VolumeHandle)->Attributes & EFI_FVB_ERASE_POLARITY) { + if (((EFI_FIRMWARE_VOLUME_HEADER*)VolumeHandle)->Attributes & EFI_FVB2_ERASE_POLARITY) { ErasePolarity = 1; } else { ErasePolarity = 0; diff --git a/MdeModulePkg/Core/Pei/PeiMain.h b/MdeModulePkg/Core/Pei/PeiMain.h index 84d187ed97..4876851cbe 100644 --- a/MdeModulePkg/Core/Pei/PeiMain.h +++ b/MdeModulePkg/Core/Pei/PeiMain.h @@ -25,8 +25,6 @@ Revision History #define _PEI_MAIN_H_ #include -#include -#include #include #include #include diff --git a/MdeModulePkg/Core/Pei/PeiMain.inf b/MdeModulePkg/Core/Pei/PeiMain.inf index 0d58f9555a..1d2c8fc5df 100644 --- a/MdeModulePkg/Core/Pei/PeiMain.inf +++ b/MdeModulePkg/Core/Pei/PeiMain.inf @@ -65,7 +65,6 @@ [Packages] MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec - IntelFrameworkPkg/IntelFrameworkPkg.dec [LibraryClasses] TimerLib @@ -101,6 +100,8 @@ [FixedPcd.common] gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv + gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValuePeimDispatch + gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValuePeiCoreEntry [FeaturePcd.common] gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst diff --git a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c index 1dd7ed3d4f..4e2d9b10aa 100644 --- a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c +++ b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c @@ -213,7 +213,7 @@ Returns: // REPORT_STATUS_CODE ( EFI_PROGRESS_CODE, - EFI_SOFTWARE_PEI_CORE | EFI_SW_PC_INIT + FixedPcdGet32 (PcdStatusCodeValuePeiCoreEntry) ); PERF_START (NULL,"PEI", NULL, mTick); -- cgit v1.2.3