From fe7819402c285c2d006b79eb66981673fedf3d04 Mon Sep 17 00:00:00 2001 From: "Zeng, Star" Date: Thu, 14 Aug 2014 05:55:08 +0000 Subject: [PATCH] MdeModulePkg/IntelFrameworkModulePkg: Update PeiCore, SmbiosDxe and IsaSerialDxe to use PcdGetxx() instead of FixedPcdGetxx(). It changes some of the PCD declarations to add more supported PCD storage types and the change in the PCD access methods is associated with that. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zeng, Star Reviewed-by: Kinney, Michael D Reviewed-by: Gao, Liming git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15798 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Bus/Isa/IsaSerialDxe/IsaSerialDxe.inf | 4 +- .../Bus/Isa/IsaSerialDxe/Serial.c | 29 +++++++++---- MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 25 +++++------ MdeModulePkg/Core/Pei/FwVol/FwVol.c | 16 +++---- MdeModulePkg/Core/Pei/PeiMain.h | 43 +++++++++++++++---- MdeModulePkg/Core/Pei/PeiMain.inf | 6 +-- MdeModulePkg/Core/Pei/PeiMain/PeiMain.c | 42 +++++++++++++++++- MdeModulePkg/Core/Pei/Ppi/Ppi.c | 14 +++--- MdeModulePkg/MdeModulePkg.dec | 30 +++++++------ MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c | 16 ++++--- .../Universal/SmbiosDxe/SmbiosDxe.inf | 4 +- 11 files changed, 154 insertions(+), 75 deletions(-) diff --git a/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/IsaSerialDxe.inf b/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/IsaSerialDxe.inf index 6f62bd4f7d..f53531f1d2 100644 --- a/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/IsaSerialDxe.inf +++ b/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/IsaSerialDxe.inf @@ -1,7 +1,7 @@ ## @file # Serial driver for standard UARTS on an ISA bus. # -# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -63,7 +63,7 @@ [FeaturePcd] gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSerialUseHalfHandshake|FALSE -[FixedPcd] +[Pcd] gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200 gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8 gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1 diff --git a/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.c b/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.c index 4a12eb9e04..15d2bab824 100644 --- a/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.c +++ b/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.c @@ -1,7 +1,7 @@ /** @file Serial driver for standard UARTS on an ISA bus. -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -43,11 +43,11 @@ SERIAL_DEV gSerialDevTempate = { { // SerialMode SERIAL_PORT_SUPPORT_CONTROL_MASK, SERIAL_PORT_DEFAULT_TIMEOUT, - FixedPcdGet64 (PcdUartDefaultBaudRate), // BaudRate + 0, SERIAL_PORT_DEFAULT_RECEIVE_FIFO_DEPTH, - FixedPcdGet8 (PcdUartDefaultDataBits), // DataBits - FixedPcdGet8 (PcdUartDefaultParity), // Parity - FixedPcdGet8 (PcdUartDefaultStopBits) // StopBits + 0, + 0, + 0 }, NULL, NULL, @@ -61,10 +61,10 @@ SERIAL_DEV gSerialDevTempate = { } }, 0, - FixedPcdGet64 (PcdUartDefaultBaudRate), - FixedPcdGet8 (PcdUartDefaultDataBits), - FixedPcdGet8 (PcdUartDefaultParity), - FixedPcdGet8 (PcdUartDefaultStopBits) + 0, + 0, + 0, + 0 }, NULL, 0, //BaseAddress @@ -163,6 +163,17 @@ InitializeIsaSerial ( ); ASSERT_EFI_ERROR (Status); + // + // Initialize UART default setting in gSerialDevTempate + // + gSerialDevTempate.SerialMode.BaudRate = PcdGet64 (PcdUartDefaultBaudRate); + gSerialDevTempate.SerialMode.DataBits = PcdGet8 (PcdUartDefaultDataBits); + gSerialDevTempate.SerialMode.Parity = PcdGet8 (PcdUartDefaultParity); + gSerialDevTempate.SerialMode.StopBits = PcdGet8 (PcdUartDefaultStopBits); + gSerialDevTempate.UartDevicePath.BaudRate = PcdGet64 (PcdUartDefaultBaudRate); + gSerialDevTempate.UartDevicePath.DataBits = PcdGet8 (PcdUartDefaultDataBits); + gSerialDevTempate.UartDevicePath.Parity = PcdGet8 (PcdUartDefaultParity); + gSerialDevTempate.UartDevicePath.StopBits = PcdGet8 (PcdUartDefaultStopBits); return Status; } diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c index ea80392dea..4004a3ad62 100644 --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c @@ -49,8 +49,8 @@ DiscoverPeimsAndOrderWithApriori ( UINTN PeimIndex; UINTN PeimCount; EFI_GUID *Guid; - EFI_PEI_FILE_HANDLE TempFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv) + 1]; - EFI_GUID FileGuid[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)]; + EFI_PEI_FILE_HANDLE *TempFileHandles; + EFI_GUID *FileGuid; EFI_PEI_FIRMWARE_VOLUME_PPI *FvPpi; EFI_FV_FILE_INFO FileInfo; @@ -63,12 +63,14 @@ DiscoverPeimsAndOrderWithApriori ( Private->CurrentFvFileHandles[0] = NULL; Guid = NULL; FileHandle = NULL; + TempFileHandles = Private->FileHandles; + FileGuid = Private->FileGuid; // // If the current Fv has been scanned, directly get its cachable record. // if (Private->Fv[Private->CurrentPeimFvCount].ScanFv) { - CopyMem (Private->CurrentFvFileHandles, Private->Fv[Private->CurrentPeimFvCount].FvFileHandles, sizeof (Private->CurrentFvFileHandles)); + CopyMem (Private->CurrentFvFileHandles, Private->Fv[Private->CurrentPeimFvCount].FvFileHandles, sizeof (EFI_PEI_FILE_HANDLE) * PcdGet32 (PcdPeiCoreMaxPeimPerFv)); return; } @@ -76,9 +78,9 @@ DiscoverPeimsAndOrderWithApriori ( // Go ahead to scan this Fv, and cache FileHandles within it. // Status = EFI_NOT_FOUND; - for (PeimCount = 0; PeimCount <= FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv); PeimCount++) { + for (PeimCount = 0; PeimCount <= PcdGet32 (PcdPeiCoreMaxPeimPerFv); PeimCount++) { Status = FvPpi->FindFileByType (FvPpi, PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE, CoreFileHandle->FvHandle, &FileHandle); - if (Status != EFI_SUCCESS || PeimCount == FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) { + if (Status != EFI_SUCCESS || PeimCount == PcdGet32 (PcdPeiCoreMaxPeimPerFv)) { break; } @@ -89,7 +91,7 @@ DiscoverPeimsAndOrderWithApriori ( // Check whether the count of files exceeds the max support files in a FV image // If more files are required in a FV image, PcdPeiCoreMaxPeimPerFv can be set to a larger value in DSC file. // - ASSERT ((Status != EFI_SUCCESS) || (PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv))); + ASSERT ((Status != EFI_SUCCESS) || (PeimCount < PcdGet32 (PcdPeiCoreMaxPeimPerFv))); // // Get Apriori File handle @@ -115,7 +117,6 @@ DiscoverPeimsAndOrderWithApriori ( } Private->AprioriCount /= sizeof (EFI_GUID); - ZeroMem (FileGuid, sizeof (FileGuid)); for (Index = 0; Index < PeimCount; Index++) { // // Make an array of file name guids that matches the FileHandle array so we can convert @@ -176,7 +177,7 @@ DiscoverPeimsAndOrderWithApriori ( // We need to update it to start with files in the A Priori list and // then the remaining files in PEIM order. // - CopyMem (Private->CurrentFvFileHandles, TempFileHandles, sizeof (Private->CurrentFvFileHandles)); + CopyMem (Private->CurrentFvFileHandles, TempFileHandles, sizeof (EFI_PEI_FILE_HANDLE) * PcdGet32 (PcdPeiCoreMaxPeimPerFv)); } } // @@ -184,7 +185,7 @@ DiscoverPeimsAndOrderWithApriori ( // Instead, we can retrieve the file handles within this Fv from cachable data. // Private->Fv[Private->CurrentPeimFvCount].ScanFv = TRUE; - CopyMem (Private->Fv[Private->CurrentPeimFvCount].FvFileHandles, Private->CurrentFvFileHandles, sizeof (Private->CurrentFvFileHandles)); + CopyMem (Private->Fv[Private->CurrentPeimFvCount].FvFileHandles, Private->CurrentFvFileHandles, sizeof (EFI_PEI_FILE_HANDLE) * PcdGet32 (PcdPeiCoreMaxPeimPerFv)); } @@ -699,7 +700,7 @@ PeiDispatcher ( SaveCurrentFileHandle = Private->CurrentFileHandle; for (Index1 = 0; Index1 <= SaveCurrentFvCount; Index1++) { - for (Index2 = 0; (Index2 < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->Fv[Index1].FvFileHandles[Index2] != NULL); Index2++) { + for (Index2 = 0; (Index2 < PcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->Fv[Index1].FvFileHandles[Index2] != NULL); Index2++) { if (Private->Fv[Index1].PeimState[Index2] == PEIM_STATE_REGISITER_FOR_SHADOW) { PeimFileHandle = Private->Fv[Index1].FvFileHandles[Index2]; Status = PeiLoadImage ( @@ -785,7 +786,7 @@ PeiDispatcher ( // Start to dispatch all modules within the current Fv. // for (PeimCount = Private->CurrentPeimCount; - (PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->CurrentFvFileHandles[PeimCount] != NULL); + (PeimCount < PcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->CurrentFvFileHandles[PeimCount] != NULL); PeimCount++) { Private->CurrentPeimCount = PeimCount; PeimFileHandle = Private->CurrentFileHandle = Private->CurrentFvFileHandles[PeimCount]; @@ -1144,7 +1145,7 @@ PeiDispatcher ( // // Before walking through the next FV,Private->CurrentFvFileHandles[]should set to NULL // - SetMem (Private->CurrentFvFileHandles, sizeof (Private->CurrentFvFileHandles), 0); + SetMem (Private->CurrentFvFileHandles, sizeof (EFI_PEI_FILE_HANDLE) * PcdGet32 (PcdPeiCoreMaxPeimPerFv), 0); } // diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c b/MdeModulePkg/Core/Pei/FwVol/FwVol.c index fe876ed393..a347129be4 100644 --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c @@ -530,8 +530,8 @@ FirmwareVolmeInfoPpiNotifyCallback ( Status = EFI_SUCCESS; PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices); - if (PrivateData->FvCount >= FixedPcdGet32 (PcdPeiCoreMaxFvSupported)) { - DEBUG ((EFI_D_ERROR, "The number of Fv Images (%d) exceed the max supported FVs (%d) in Pei", PrivateData->FvCount + 1, FixedPcdGet32 (PcdPeiCoreMaxFvSupported))); + if (PrivateData->FvCount >= PcdGet32 (PcdPeiCoreMaxFvSupported)) { + DEBUG ((EFI_D_ERROR, "The number of Fv Images (%d) exceed the max supported FVs (%d) in Pei", PrivateData->FvCount + 1, PcdGet32 (PcdPeiCoreMaxFvSupported))); DEBUG ((EFI_D_ERROR, "PcdPeiCoreMaxFvSupported value need be reconfigurated in DSC")); ASSERT (FALSE); } @@ -1967,7 +1967,7 @@ FindNextCoreFvHandle ( } } - ASSERT (Private->FvCount <= FixedPcdGet32 (PcdPeiCoreMaxFvSupported)); + ASSERT (Private->FvCount <= PcdGet32 (PcdPeiCoreMaxFvSupported)); if (Instance >= Private->FvCount) { return NULL; } @@ -2015,7 +2015,7 @@ PeiReinitializeFv ( // // Fixup all FvPpi pointers for the implementation in flash to permanent memory. // - for (Index = 0; Index < FixedPcdGet32 (PcdPeiCoreMaxFvSupported); Index ++) { + for (Index = 0; Index < PcdGet32 (PcdPeiCoreMaxFvSupported); Index ++) { if (PrivateData->Fv[Index].FvPpi == OldFfsFvPpi) { PrivateData->Fv[Index].FvPpi = &mPeiFfs2FwVol.Fv; } @@ -2043,7 +2043,7 @@ PeiReinitializeFv ( // // Fixup all FvPpi pointers for the implementation in flash to permanent memory. // - for (Index = 0; Index < FixedPcdGet32 (PcdPeiCoreMaxFvSupported); Index ++) { + for (Index = 0; Index < PcdGet32 (PcdPeiCoreMaxFvSupported); Index ++) { if (PrivateData->Fv[Index].FvPpi == OldFfsFvPpi) { PrivateData->Fv[Index].FvPpi = &mPeiFfs3FwVol.Fv; } @@ -2074,7 +2074,7 @@ AddUnknownFormatFvInfo ( { PEI_CORE_UNKNOW_FORMAT_FV_INFO *NewUnknownFv; - if (PrivateData->UnknownFvInfoCount + 1 >= FixedPcdGet32 (PcdPeiCoreMaxFvSupported)) { + if (PrivateData->UnknownFvInfoCount + 1 >= PcdGet32 (PcdPeiCoreMaxFvSupported)) { return EFI_OUT_OF_RESOURCES; } @@ -2212,8 +2212,8 @@ ThirdPartyFvPpiNotifyCallback ( continue; } - if (PrivateData->FvCount >= FixedPcdGet32 (PcdPeiCoreMaxFvSupported)) { - DEBUG ((EFI_D_ERROR, "The number of Fv Images (%d) exceed the max supported FVs (%d) in Pei", PrivateData->FvCount + 1, FixedPcdGet32 (PcdPeiCoreMaxFvSupported))); + if (PrivateData->FvCount >= PcdGet32 (PcdPeiCoreMaxFvSupported)) { + DEBUG ((EFI_D_ERROR, "The number of Fv Images (%d) exceed the max supported FVs (%d) in Pei", PrivateData->FvCount + 1, PcdGet32 (PcdPeiCoreMaxFvSupported))); DEBUG ((EFI_D_ERROR, "PcdPeiCoreMaxFvSupported value need be reconfigurated in DSC")); ASSERT (FALSE); } diff --git a/MdeModulePkg/Core/Pei/PeiMain.h b/MdeModulePkg/Core/Pei/PeiMain.h index 9656f07186..8c7cfe4cac 100644 --- a/MdeModulePkg/Core/Pei/PeiMain.h +++ b/MdeModulePkg/Core/Pei/PeiMain.h @@ -1,7 +1,7 @@ /** @file Definition of Pei Core Structures and Services -Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -89,9 +89,9 @@ typedef struct { /// INTN LastDispatchedNotify; /// - /// Ppi database. + /// Ppi database has the PcdPeiCoreMaxPpiSupported number of entries. /// - PEI_PPI_LIST_POINTERS PpiListPtrs[FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)]; + PEI_PPI_LIST_POINTERS *PpiListPtrs; } PEI_PPI_DATABASE; @@ -109,8 +109,14 @@ typedef struct { EFI_FIRMWARE_VOLUME_HEADER *FvHeader; EFI_PEI_FIRMWARE_VOLUME_PPI *FvPpi; EFI_PEI_FV_HANDLE FvHandle; - UINT8 PeimState[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)]; - EFI_PEI_FILE_HANDLE FvFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)]; + // + // Ponter to the buffer with the PcdPeiCoreMaxPeimPerFv number of Entries. + // + UINT8 *PeimState; + // + // Ponter to the buffer with the PcdPeiCoreMaxPeimPerFv number of Entries. + // + EFI_PEI_FILE_HANDLE *FvFileHandles; BOOLEAN ScanFv; UINT32 AuthenticationStatus; } PEI_CORE_FV_HANDLE; @@ -188,13 +194,22 @@ struct _PEI_CORE_INSTANCE { UINTN FvCount; /// - /// The instance arrary for FVs which contains FFS and could be dispatched by PeiCore. + /// Pointer to the buffer with the PcdPeiCoreMaxFvSupported number of entries. + /// Each entry is for one FV which contains FFS and could be dispatched by PeiCore. /// - PEI_CORE_FV_HANDLE Fv[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)]; - PEI_CORE_UNKNOW_FORMAT_FV_INFO UnknownFvInfo[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)]; + PEI_CORE_FV_HANDLE *Fv; + + /// + /// Pointer to the buffer with the PcdPeiCoreMaxFvSupported number of entries. + /// Each entry is for one FV which could not be dispatched by PeiCore. + /// + PEI_CORE_UNKNOW_FORMAT_FV_INFO *UnknownFvInfo; UINTN UnknownFvInfoCount; - EFI_PEI_FILE_HANDLE CurrentFvFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)]; + /// + /// Pointer to the buffer with the PcdPeiCoreMaxPeimPerFv number of entries. + /// + EFI_PEI_FILE_HANDLE *CurrentFvFileHandles; UINTN AprioriCount; UINTN CurrentPeimFvCount; UINTN CurrentPeimCount; @@ -234,6 +249,16 @@ struct _PEI_CORE_INSTANCE { // This field points to the shadowed image read function // PE_COFF_LOADER_READ_FILE ShadowedImageRead; + + // + // Pointer to the temp buffer with the PcdPeiCoreMaxPeimPerFv + 1 number of entries. + // + EFI_PEI_FILE_HANDLE *FileHandles; + // + // Pointer to the temp buffer with the PcdPeiCoreMaxPeimPerFv number of entries. + // + EFI_GUID *FileGuid; + // // Temp Memory Range is not covered by PeiTempMem and Stack. // Those Memory Range will be migrated into phisical memory. diff --git a/MdeModulePkg/Core/Pei/PeiMain.inf b/MdeModulePkg/Core/Pei/PeiMain.inf index 27e7542838..7cff0632a3 100644 --- a/MdeModulePkg/Core/Pei/PeiMain.inf +++ b/MdeModulePkg/Core/Pei/PeiMain.inf @@ -4,7 +4,7 @@ # 2) Dispatch PEIM from discovered FV. # 3) Handoff control to DxeIpl to load DXE core and enter DXE phase. # -# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -87,12 +87,10 @@ gEfiTemporaryRamSupportPpiGuid ## SOMETIMES_CONSUMES gEfiTemporaryRamDonePpiGuid ## SOMETIMES_CONSUMES -[FixedPcd] +[Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPpiSupported ## CONSUMES - -[Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeiStackSize ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkCompatibilitySupport ## CONSUMES diff --git a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c index 6429ad3a21..d105fce28d 100644 --- a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c +++ b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c @@ -1,7 +1,7 @@ /** @file Pei Core Main Entry Point -Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -152,6 +152,7 @@ PeiCore ( EFI_PEI_PCI_CFG2_PPI *PciCfg; EFI_HOB_HANDOFF_INFO_TABLE *HandoffInformationTable; EFI_PEI_TEMPORARY_RAM_DONE_PPI *TemporaryRamDonePpi; + UINTN Index; // // Retrieve context passed into PEI Core @@ -181,8 +182,28 @@ PeiCore ( OldCoreData->CpuIo = &OldCoreData->ServiceTableShadow.CpuIo; if (OldCoreData->HeapOffsetPositive) { OldCoreData->HobList.Raw = (VOID *)(OldCoreData->HobList.Raw + OldCoreData->HeapOffset); + OldCoreData->UnknownFvInfo = (PEI_CORE_UNKNOW_FORMAT_FV_INFO *) ((UINT8 *) OldCoreData->UnknownFvInfo + OldCoreData->HeapOffset); + OldCoreData->CurrentFvFileHandles = (EFI_PEI_FILE_HANDLE *) ((UINT8 *) OldCoreData->CurrentFvFileHandles + OldCoreData->HeapOffset); + OldCoreData->PpiData.PpiListPtrs = (PEI_PPI_LIST_POINTERS *) ((UINT8 *) OldCoreData->PpiData.PpiListPtrs + OldCoreData->HeapOffset); + OldCoreData->Fv = (PEI_CORE_FV_HANDLE *) ((UINT8 *) OldCoreData->Fv + OldCoreData->HeapOffset); + for (Index = 0; Index < PcdGet32 (PcdPeiCoreMaxFvSupported); Index ++) { + OldCoreData->Fv[Index].PeimState = (UINT8 *) OldCoreData->Fv[Index].PeimState + OldCoreData->HeapOffset; + OldCoreData->Fv[Index].FvFileHandles = (EFI_PEI_FILE_HANDLE *) ((UINT8 *) OldCoreData->Fv[Index].FvFileHandles + OldCoreData->HeapOffset); + } + OldCoreData->FileGuid = (EFI_GUID *) ((UINT8 *) OldCoreData->FileGuid + OldCoreData->HeapOffset); + OldCoreData->FileHandles = (EFI_PEI_FILE_HANDLE *) ((UINT8 *) OldCoreData->FileHandles + OldCoreData->HeapOffset); } else { OldCoreData->HobList.Raw = (VOID *)(OldCoreData->HobList.Raw - OldCoreData->HeapOffset); + OldCoreData->UnknownFvInfo = (PEI_CORE_UNKNOW_FORMAT_FV_INFO *) ((UINT8 *) OldCoreData->UnknownFvInfo - OldCoreData->HeapOffset); + OldCoreData->CurrentFvFileHandles = (EFI_PEI_FILE_HANDLE *) ((UINT8 *) OldCoreData->CurrentFvFileHandles - OldCoreData->HeapOffset); + OldCoreData->PpiData.PpiListPtrs = (PEI_PPI_LIST_POINTERS *) ((UINT8 *) OldCoreData->PpiData.PpiListPtrs - OldCoreData->HeapOffset); + OldCoreData->Fv = (PEI_CORE_FV_HANDLE *) ((UINT8 *) OldCoreData->Fv - OldCoreData->HeapOffset); + for (Index = 0; Index < PcdGet32 (PcdPeiCoreMaxFvSupported); Index ++) { + OldCoreData->Fv[Index].PeimState = (UINT8 *) OldCoreData->Fv[Index].PeimState - OldCoreData->HeapOffset; + OldCoreData->Fv[Index].FvFileHandles = (EFI_PEI_FILE_HANDLE *) ((UINT8 *) OldCoreData->Fv[Index].FvFileHandles - OldCoreData->HeapOffset); + } + OldCoreData->FileGuid = (EFI_GUID *) ((UINT8 *) OldCoreData->FileGuid - OldCoreData->HeapOffset); + OldCoreData->FileHandles = (EFI_PEI_FILE_HANDLE *) ((UINT8 *) OldCoreData->FileHandles - OldCoreData->HeapOffset); } // @@ -285,8 +306,25 @@ PeiCore ( // // Initialize PEI Core Services - // + // InitializeMemoryServices (&PrivateData, SecCoreData, OldCoreData); + if (OldCoreData == NULL) { + // + // Initialize PEI Core Private Data Buffer + // + PrivateData.PpiData.PpiListPtrs = AllocateZeroPool (sizeof (PEI_PPI_LIST_POINTERS) * PcdGet32 (PcdPeiCoreMaxPpiSupported)); + PrivateData.Fv = AllocateZeroPool (sizeof (PEI_CORE_FV_HANDLE) * PcdGet32 (PcdPeiCoreMaxFvSupported)); + PrivateData.Fv[0].PeimState = AllocateZeroPool (sizeof (UINT8) * PcdGet32 (PcdPeiCoreMaxPeimPerFv) * PcdGet32 (PcdPeiCoreMaxFvSupported)); + PrivateData.Fv[0].FvFileHandles = AllocateZeroPool (sizeof (EFI_PEI_FILE_HANDLE) * PcdGet32 (PcdPeiCoreMaxPeimPerFv) * PcdGet32 (PcdPeiCoreMaxFvSupported)); + for (Index = 1; Index < PcdGet32 (PcdPeiCoreMaxFvSupported); Index ++) { + PrivateData.Fv[Index].PeimState = PrivateData.Fv[Index - 1].PeimState + PcdGet32 (PcdPeiCoreMaxPeimPerFv); + PrivateData.Fv[Index].FvFileHandles = PrivateData.Fv[Index - 1].FvFileHandles + PcdGet32 (PcdPeiCoreMaxPeimPerFv); + } + PrivateData.UnknownFvInfo = AllocateZeroPool (sizeof (PEI_CORE_UNKNOW_FORMAT_FV_INFO) * PcdGet32 (PcdPeiCoreMaxFvSupported)); + PrivateData.CurrentFvFileHandles = AllocateZeroPool (sizeof (EFI_PEI_FILE_HANDLE) * PcdGet32 (PcdPeiCoreMaxPeimPerFv)); + PrivateData.FileGuid = AllocatePool (sizeof (EFI_GUID) * PcdGet32 (PcdPeiCoreMaxPeimPerFv)); + PrivateData.FileHandles = AllocatePool (sizeof (EFI_PEI_FILE_HANDLE) * (PcdGet32 (PcdPeiCoreMaxPeimPerFv) + 1)); + } InitializePpiServices (&PrivateData, OldCoreData); // diff --git a/MdeModulePkg/Core/Pei/Ppi/Ppi.c b/MdeModulePkg/Core/Pei/Ppi/Ppi.c index 9fe95acb86..706e835a70 100644 --- a/MdeModulePkg/Core/Pei/Ppi/Ppi.c +++ b/MdeModulePkg/Core/Pei/Ppi/Ppi.c @@ -1,7 +1,7 @@ /** @file EFI PEI Core PPI services -Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -30,9 +30,9 @@ InitializePpiServices ( ) { if (OldCoreData == NULL) { - PrivateData->PpiData.NotifyListEnd = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1; - PrivateData->PpiData.DispatchListEnd = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1; - PrivateData->PpiData.LastDispatchedNotify = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1; + PrivateData->PpiData.NotifyListEnd = PcdGet32 (PcdPeiCoreMaxPpiSupported)-1; + PrivateData->PpiData.DispatchListEnd = PcdGet32 (PcdPeiCoreMaxPpiSupported)-1; + PrivateData->PpiData.LastDispatchedNotify = PcdGet32 (PcdPeiCoreMaxPpiSupported)-1; } } @@ -119,7 +119,7 @@ ConvertPpiPointers ( UINT8 Index; UINT8 IndexHole; - for (Index = 0; Index < FixedPcdGet32 (PcdPeiCoreMaxPpiSupported); Index++) { + for (Index = 0; Index < PcdGet32 (PcdPeiCoreMaxPpiSupported); Index++) { if (Index < PrivateData->PpiData.PpiListEnd || Index > PrivateData->PpiData.NotifyListEnd) { // // Convert PPI pointer in old Heap @@ -312,7 +312,7 @@ PeiReInstallPpi ( // Remove the old PPI from the database, add the new one. // DEBUG((EFI_D_INFO, "Reinstall PPI: %g\n", NewPpi->Guid)); - ASSERT (Index < (INTN)(FixedPcdGet32 (PcdPeiCoreMaxPpiSupported))); + ASSERT (Index < (INTN)(PcdGet32 (PcdPeiCoreMaxPpiSupported))); PrivateData->PpiData.PpiListPtrs[Index].Ppi = (EFI_PEI_PPI_DESCRIPTOR *) NewPpi; // @@ -570,7 +570,7 @@ ProcessNotifyList ( EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH, PrivateData->PpiData.LastDispatchedInstall, PrivateData->PpiData.PpiListEnd, - FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1, + PcdGet32 (PcdPeiCoreMaxPpiSupported)-1, PrivateData->PpiData.DispatchListEnd ); PrivateData->PpiData.LastDispatchedInstall = TempValue; diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 47d9fdda1a..7fec666c79 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -528,19 +528,9 @@ # for a dynamic PCD used in PEI phase. gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPcdCallBackNumberPerPcdEntry|0x08|UINT32|0x0001000f - ## Maximum number of FV is supported by PeiCore's dispatching. - gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported|6|UINT32|0x00010030 - - ## Maximum File count in every FV is supported by PeiCore's dispatching. - # PeiCore supported File type includes PEIM, Combined PEIM and FV. - gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv|32|UINT32|0x00010031 - ## Maximum stack size for PeiCore. gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeiStackSize|0x20000|UINT32|0x00010032 - ## Maximum PPI count is supported by PeiCore's PPI database. - gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPpiSupported|64|UINT32|0x00010033 - ## Size of the NV variable range. Note that this value should less than or equal to PcdFlashNvStorageFtwSpareSize # The root cause is that variable driver will use FTW protocol to reclaim variable region. # If the length of variable region is larger than FTW spare size, it means the whole variable region can not @@ -585,9 +575,6 @@ # Other Value: Enable the feature as fixed absolute address, and the value is the top memory address gEfiMdeModulePkgTokenSpaceGuid.PcdLoadModuleAtFixAddressEnable|0|UINT64|0x30001015 - ## Smbios version - gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0208|UINT16|0x00010055 - ## TFTP BlockSize. Initial value 0 means using default block size which is (MTU-IP_HEADER-UDP_HEADER-TFTP_HEADER) # to handle all link layers. If the value is non zero, the PCD value will be used as block size. # @@ -619,6 +606,19 @@ # gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0|UINT32|0x00010010 + ## Maximum number of FV is supported by PeiCore's dispatching. + # @Prompt Maximum number of FV supported by PeiCore. + gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported|6|UINT32|0x00010030 + + ## Maximum File count in every FV is supported by PeiCore's dispatching. + # PeiCore supported File type includes PEIM, Combined PEIM and FV. + # @Prompt Maximum File count per FV supported by PeiCore. + gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv|32|UINT32|0x00010031 + + ## Maximum PPI count is supported by PeiCore's PPI database. + # @Prompt Maximum PPI count supported by PeiCore. + gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPpiSupported|64|UINT32|0x00010033 + ## Maximun number of performance log entries during PEI phase. gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries|40|UINT8|0x0001002f @@ -897,6 +897,10 @@ ## This PCD specifies whether 1G page table is enabled. gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable|FALSE|BOOLEAN|0x0001005E + ## Smbios version. + # @Prompt Smbios version. + gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0208|UINT16|0x00010055 + ## This PCD specifies the additional pad size in FPDT Basic Boot Performance Table for # the extension FPDT boot records got after ReadyToBoot and before ExitBootService. gEfiMdeModulePkgTokenSpaceGuid.PcdExtFpdtBootRecordPadSize|0x0|UINT32|0x0001005F diff --git a/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c b/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c index 329bdbfc49..c0128f088f 100644 --- a/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c +++ b/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c @@ -2,7 +2,7 @@ This code produces the Smbios protocol. It also responsible for constructing SMBIOS table into system table. -Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
+Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -49,11 +49,11 @@ SMBIOS_TABLE_ENTRY_POINT EntryPointStructureData = { // // MajorVersion // - (UINT8) (FixedPcdGet16 (PcdSmbiosVersion) >> 8), + 0, // // MinorVersion // - (UINT8) (FixedPcdGet16 (PcdSmbiosVersion) & 0x00ff), + 0, // // MaxStructureSize, TO BE FILLED // @@ -101,8 +101,7 @@ SMBIOS_TABLE_ENTRY_POINT EntryPointStructureData = { // // SmbiosBcdRevision // - (UINT8) ((FixedPcdGet16 (PcdSmbiosVersion) >> 4) & 0xf0) - | (UINT8) (FixedPcdGet16 (PcdSmbiosVersion) & 0x0f) + 0 }; @@ -1079,8 +1078,11 @@ SmbiosDriverEntryPoint ( mPrivateData.Smbios.UpdateString = SmbiosUpdateString; mPrivateData.Smbios.Remove = SmbiosRemove; mPrivateData.Smbios.GetNext = SmbiosGetNext; - mPrivateData.Smbios.MajorVersion = (UINT8) (FixedPcdGet16 (PcdSmbiosVersion) >> 8); - mPrivateData.Smbios.MinorVersion = (UINT8) (FixedPcdGet16 (PcdSmbiosVersion) & 0x00ff); + mPrivateData.Smbios.MajorVersion = (UINT8) (PcdGet16 (PcdSmbiosVersion) >> 8); + mPrivateData.Smbios.MinorVersion = (UINT8) (PcdGet16 (PcdSmbiosVersion) & 0x00ff); + EntryPointStructureData.MajorVersion = mPrivateData.Smbios.MajorVersion; + EntryPointStructureData.MinorVersion = mPrivateData.Smbios.MinorVersion; + EntryPointStructureData.SmbiosBcdRevision = (UINT8) ((PcdGet16 (PcdSmbiosVersion) >> 4) & 0xf0) | (UINT8) (PcdGet16 (PcdSmbiosVersion) & 0x0f); InitializeListHead (&mPrivateData.DataListHead); InitializeListHead (&mPrivateData.AllocatedHandleListHead); diff --git a/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf b/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf index c4524837bd..f385df10ca 100644 --- a/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf +++ b/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf @@ -2,7 +2,7 @@ # Component description file for Smbios module. # # This driver initializes and installs the SMBIOS protocol. -# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -54,7 +54,7 @@ gEfiEventReadyToBootGuid # PROTOCOL ALWAYS_CONSUMED gEfiSmbiosTableGuid # PROTOCOL ALWAYS_CONSUMED -[FixedPcd] +[Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion [Depex] -- 2.39.2