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 <star.zeng@intel.com>
Reviewed-by: Kinney, Michael D <michael.d.kinney@intel.com>
Reviewed-by: Gao, Liming <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15798 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Zeng, Star
2014-08-14 05:55:08 +00:00
committed by lzeng14
parent a1360fa3de
commit fe7819402c
11 changed files with 154 additions and 75 deletions

View File

@ -1,7 +1,7 @@
## @file ## @file
# Serial driver for standard UARTS on an ISA bus. # Serial driver for standard UARTS on an ISA bus.
# #
# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -63,7 +63,7 @@
[FeaturePcd] [FeaturePcd]
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSerialUseHalfHandshake|FALSE gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSerialUseHalfHandshake|FALSE
[FixedPcd] [Pcd]
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200 gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8 gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1 gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1

View File

@ -1,7 +1,7 @@
/** @file /** @file
Serial driver for standard UARTS on an ISA bus. Serial driver for standard UARTS on an ISA bus.
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -43,11 +43,11 @@ SERIAL_DEV gSerialDevTempate = {
{ // SerialMode { // SerialMode
SERIAL_PORT_SUPPORT_CONTROL_MASK, SERIAL_PORT_SUPPORT_CONTROL_MASK,
SERIAL_PORT_DEFAULT_TIMEOUT, SERIAL_PORT_DEFAULT_TIMEOUT,
FixedPcdGet64 (PcdUartDefaultBaudRate), // BaudRate 0,
SERIAL_PORT_DEFAULT_RECEIVE_FIFO_DEPTH, SERIAL_PORT_DEFAULT_RECEIVE_FIFO_DEPTH,
FixedPcdGet8 (PcdUartDefaultDataBits), // DataBits 0,
FixedPcdGet8 (PcdUartDefaultParity), // Parity 0,
FixedPcdGet8 (PcdUartDefaultStopBits) // StopBits 0
}, },
NULL, NULL,
NULL, NULL,
@ -61,10 +61,10 @@ SERIAL_DEV gSerialDevTempate = {
} }
}, },
0, 0,
FixedPcdGet64 (PcdUartDefaultBaudRate), 0,
FixedPcdGet8 (PcdUartDefaultDataBits), 0,
FixedPcdGet8 (PcdUartDefaultParity), 0,
FixedPcdGet8 (PcdUartDefaultStopBits) 0
}, },
NULL, NULL,
0, //BaseAddress 0, //BaseAddress
@ -163,6 +163,17 @@ InitializeIsaSerial (
); );
ASSERT_EFI_ERROR (Status); 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; return Status;
} }

View File

@ -49,8 +49,8 @@ DiscoverPeimsAndOrderWithApriori (
UINTN PeimIndex; UINTN PeimIndex;
UINTN PeimCount; UINTN PeimCount;
EFI_GUID *Guid; EFI_GUID *Guid;
EFI_PEI_FILE_HANDLE TempFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv) + 1]; EFI_PEI_FILE_HANDLE *TempFileHandles;
EFI_GUID FileGuid[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)]; EFI_GUID *FileGuid;
EFI_PEI_FIRMWARE_VOLUME_PPI *FvPpi; EFI_PEI_FIRMWARE_VOLUME_PPI *FvPpi;
EFI_FV_FILE_INFO FileInfo; EFI_FV_FILE_INFO FileInfo;
@ -63,12 +63,14 @@ DiscoverPeimsAndOrderWithApriori (
Private->CurrentFvFileHandles[0] = NULL; Private->CurrentFvFileHandles[0] = NULL;
Guid = NULL; Guid = NULL;
FileHandle = NULL; FileHandle = NULL;
TempFileHandles = Private->FileHandles;
FileGuid = Private->FileGuid;
// //
// If the current Fv has been scanned, directly get its cachable record. // If the current Fv has been scanned, directly get its cachable record.
// //
if (Private->Fv[Private->CurrentPeimFvCount].ScanFv) { 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; return;
} }
@ -76,9 +78,9 @@ DiscoverPeimsAndOrderWithApriori (
// Go ahead to scan this Fv, and cache FileHandles within it. // Go ahead to scan this Fv, and cache FileHandles within it.
// //
Status = EFI_NOT_FOUND; 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); 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; break;
} }
@ -89,7 +91,7 @@ DiscoverPeimsAndOrderWithApriori (
// Check whether the count of files exceeds the max support files in a FV image // 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. // 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 // Get Apriori File handle
@ -115,7 +117,6 @@ DiscoverPeimsAndOrderWithApriori (
} }
Private->AprioriCount /= sizeof (EFI_GUID); Private->AprioriCount /= sizeof (EFI_GUID);
ZeroMem (FileGuid, sizeof (FileGuid));
for (Index = 0; Index < PeimCount; Index++) { for (Index = 0; Index < PeimCount; Index++) {
// //
// Make an array of file name guids that matches the FileHandle array so we can convert // 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 // We need to update it to start with files in the A Priori list and
// then the remaining files in PEIM order. // 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. // Instead, we can retrieve the file handles within this Fv from cachable data.
// //
Private->Fv[Private->CurrentPeimFvCount].ScanFv = TRUE; 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; SaveCurrentFileHandle = Private->CurrentFileHandle;
for (Index1 = 0; Index1 <= SaveCurrentFvCount; Index1++) { 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) { if (Private->Fv[Index1].PeimState[Index2] == PEIM_STATE_REGISITER_FOR_SHADOW) {
PeimFileHandle = Private->Fv[Index1].FvFileHandles[Index2]; PeimFileHandle = Private->Fv[Index1].FvFileHandles[Index2];
Status = PeiLoadImage ( Status = PeiLoadImage (
@ -785,7 +786,7 @@ PeiDispatcher (
// Start to dispatch all modules within the current Fv. // Start to dispatch all modules within the current Fv.
// //
for (PeimCount = Private->CurrentPeimCount; for (PeimCount = Private->CurrentPeimCount;
(PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->CurrentFvFileHandles[PeimCount] != NULL); (PeimCount < PcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->CurrentFvFileHandles[PeimCount] != NULL);
PeimCount++) { PeimCount++) {
Private->CurrentPeimCount = PeimCount; Private->CurrentPeimCount = PeimCount;
PeimFileHandle = Private->CurrentFileHandle = Private->CurrentFvFileHandles[PeimCount]; PeimFileHandle = Private->CurrentFileHandle = Private->CurrentFvFileHandles[PeimCount];
@ -1144,7 +1145,7 @@ PeiDispatcher (
// //
// Before walking through the next FV,Private->CurrentFvFileHandles[]should set to NULL // 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);
} }
// //

View File

@ -530,8 +530,8 @@ FirmwareVolmeInfoPpiNotifyCallback (
Status = EFI_SUCCESS; Status = EFI_SUCCESS;
PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices); PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);
if (PrivateData->FvCount >= 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, FixedPcdGet32 (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")); DEBUG ((EFI_D_ERROR, "PcdPeiCoreMaxFvSupported value need be reconfigurated in DSC"));
ASSERT (FALSE); ASSERT (FALSE);
} }
@ -1967,7 +1967,7 @@ FindNextCoreFvHandle (
} }
} }
ASSERT (Private->FvCount <= FixedPcdGet32 (PcdPeiCoreMaxFvSupported)); ASSERT (Private->FvCount <= PcdGet32 (PcdPeiCoreMaxFvSupported));
if (Instance >= Private->FvCount) { if (Instance >= Private->FvCount) {
return NULL; return NULL;
} }
@ -2015,7 +2015,7 @@ PeiReinitializeFv (
// //
// Fixup all FvPpi pointers for the implementation in flash to permanent memory. // 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) { if (PrivateData->Fv[Index].FvPpi == OldFfsFvPpi) {
PrivateData->Fv[Index].FvPpi = &mPeiFfs2FwVol.Fv; PrivateData->Fv[Index].FvPpi = &mPeiFfs2FwVol.Fv;
} }
@ -2043,7 +2043,7 @@ PeiReinitializeFv (
// //
// Fixup all FvPpi pointers for the implementation in flash to permanent memory. // 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) { if (PrivateData->Fv[Index].FvPpi == OldFfsFvPpi) {
PrivateData->Fv[Index].FvPpi = &mPeiFfs3FwVol.Fv; PrivateData->Fv[Index].FvPpi = &mPeiFfs3FwVol.Fv;
} }
@ -2074,7 +2074,7 @@ AddUnknownFormatFvInfo (
{ {
PEI_CORE_UNKNOW_FORMAT_FV_INFO *NewUnknownFv; PEI_CORE_UNKNOW_FORMAT_FV_INFO *NewUnknownFv;
if (PrivateData->UnknownFvInfoCount + 1 >= FixedPcdGet32 (PcdPeiCoreMaxFvSupported)) { if (PrivateData->UnknownFvInfoCount + 1 >= PcdGet32 (PcdPeiCoreMaxFvSupported)) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -2212,8 +2212,8 @@ ThirdPartyFvPpiNotifyCallback (
continue; continue;
} }
if (PrivateData->FvCount >= 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, FixedPcdGet32 (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")); DEBUG ((EFI_D_ERROR, "PcdPeiCoreMaxFvSupported value need be reconfigurated in DSC"));
ASSERT (FALSE); ASSERT (FALSE);
} }

View File

@ -1,7 +1,7 @@
/** @file /** @file
Definition of Pei Core Structures and Services Definition of Pei Core Structures and Services
Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -89,9 +89,9 @@ typedef struct {
/// ///
INTN LastDispatchedNotify; 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; } PEI_PPI_DATABASE;
@ -109,8 +109,14 @@ typedef struct {
EFI_FIRMWARE_VOLUME_HEADER *FvHeader; EFI_FIRMWARE_VOLUME_HEADER *FvHeader;
EFI_PEI_FIRMWARE_VOLUME_PPI *FvPpi; EFI_PEI_FIRMWARE_VOLUME_PPI *FvPpi;
EFI_PEI_FV_HANDLE FvHandle; 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; BOOLEAN ScanFv;
UINT32 AuthenticationStatus; UINT32 AuthenticationStatus;
} PEI_CORE_FV_HANDLE; } PEI_CORE_FV_HANDLE;
@ -188,13 +194,22 @@ struct _PEI_CORE_INSTANCE {
UINTN FvCount; 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_FV_HANDLE *Fv;
PEI_CORE_UNKNOW_FORMAT_FV_INFO UnknownFvInfo[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)];
///
/// 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; 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 AprioriCount;
UINTN CurrentPeimFvCount; UINTN CurrentPeimFvCount;
UINTN CurrentPeimCount; UINTN CurrentPeimCount;
@ -234,6 +249,16 @@ struct _PEI_CORE_INSTANCE {
// This field points to the shadowed image read function // This field points to the shadowed image read function
// //
PE_COFF_LOADER_READ_FILE ShadowedImageRead; 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. // Temp Memory Range is not covered by PeiTempMem and Stack.
// Those Memory Range will be migrated into phisical memory. // Those Memory Range will be migrated into phisical memory.

View File

@ -4,7 +4,7 @@
# 2) Dispatch PEIM from discovered FV. # 2) Dispatch PEIM from discovered FV.
# 3) Handoff control to DxeIpl to load DXE core and enter DXE phase. # 3) Handoff control to DxeIpl to load DXE core and enter DXE phase.
# #
# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -87,12 +87,10 @@
gEfiTemporaryRamSupportPpiGuid ## SOMETIMES_CONSUMES gEfiTemporaryRamSupportPpiGuid ## SOMETIMES_CONSUMES
gEfiTemporaryRamDonePpiGuid ## SOMETIMES_CONSUMES gEfiTemporaryRamDonePpiGuid ## SOMETIMES_CONSUMES
[FixedPcd] [Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPpiSupported ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPpiSupported ## CONSUMES
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeiStackSize ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeiStackSize ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkCompatibilitySupport ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkCompatibilitySupport ## CONSUMES

View File

@ -1,7 +1,7 @@
/** @file /** @file
Pei Core Main Entry Point Pei Core Main Entry Point
Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 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_PEI_PCI_CFG2_PPI *PciCfg;
EFI_HOB_HANDOFF_INFO_TABLE *HandoffInformationTable; EFI_HOB_HANDOFF_INFO_TABLE *HandoffInformationTable;
EFI_PEI_TEMPORARY_RAM_DONE_PPI *TemporaryRamDonePpi; EFI_PEI_TEMPORARY_RAM_DONE_PPI *TemporaryRamDonePpi;
UINTN Index;
// //
// Retrieve context passed into PEI Core // Retrieve context passed into PEI Core
@ -181,8 +182,28 @@ PeiCore (
OldCoreData->CpuIo = &OldCoreData->ServiceTableShadow.CpuIo; OldCoreData->CpuIo = &OldCoreData->ServiceTableShadow.CpuIo;
if (OldCoreData->HeapOffsetPositive) { if (OldCoreData->HeapOffsetPositive) {
OldCoreData->HobList.Raw = (VOID *)(OldCoreData->HobList.Raw + OldCoreData->HeapOffset); 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 { } else {
OldCoreData->HobList.Raw = (VOID *)(OldCoreData->HobList.Raw - OldCoreData->HeapOffset); 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 // Initialize PEI Core Services
// //
InitializeMemoryServices (&PrivateData, SecCoreData, OldCoreData); 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); InitializePpiServices (&PrivateData, OldCoreData);
// //

View File

@ -1,7 +1,7 @@
/** @file /** @file
EFI PEI Core PPI services EFI PEI Core PPI services
Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -30,9 +30,9 @@ InitializePpiServices (
) )
{ {
if (OldCoreData == NULL) { if (OldCoreData == NULL) {
PrivateData->PpiData.NotifyListEnd = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1; PrivateData->PpiData.NotifyListEnd = PcdGet32 (PcdPeiCoreMaxPpiSupported)-1;
PrivateData->PpiData.DispatchListEnd = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1; PrivateData->PpiData.DispatchListEnd = PcdGet32 (PcdPeiCoreMaxPpiSupported)-1;
PrivateData->PpiData.LastDispatchedNotify = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1; PrivateData->PpiData.LastDispatchedNotify = PcdGet32 (PcdPeiCoreMaxPpiSupported)-1;
} }
} }
@ -119,7 +119,7 @@ ConvertPpiPointers (
UINT8 Index; UINT8 Index;
UINT8 IndexHole; 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) { if (Index < PrivateData->PpiData.PpiListEnd || Index > PrivateData->PpiData.NotifyListEnd) {
// //
// Convert PPI pointer in old Heap // Convert PPI pointer in old Heap
@ -312,7 +312,7 @@ PeiReInstallPpi (
// Remove the old PPI from the database, add the new one. // Remove the old PPI from the database, add the new one.
// //
DEBUG((EFI_D_INFO, "Reinstall PPI: %g\n", NewPpi->Guid)); 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; PrivateData->PpiData.PpiListPtrs[Index].Ppi = (EFI_PEI_PPI_DESCRIPTOR *) NewPpi;
// //
@ -570,7 +570,7 @@ ProcessNotifyList (
EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH, EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH,
PrivateData->PpiData.LastDispatchedInstall, PrivateData->PpiData.LastDispatchedInstall,
PrivateData->PpiData.PpiListEnd, PrivateData->PpiData.PpiListEnd,
FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1, PcdGet32 (PcdPeiCoreMaxPpiSupported)-1,
PrivateData->PpiData.DispatchListEnd PrivateData->PpiData.DispatchListEnd
); );
PrivateData->PpiData.LastDispatchedInstall = TempValue; PrivateData->PpiData.LastDispatchedInstall = TempValue;

View File

@ -528,19 +528,9 @@
# for a dynamic PCD used in PEI phase. # for a dynamic PCD used in PEI phase.
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPcdCallBackNumberPerPcdEntry|0x08|UINT32|0x0001000f 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. ## Maximum stack size for PeiCore.
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeiStackSize|0x20000|UINT32|0x00010032 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 ## 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. # 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 # 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 # Other Value: Enable the feature as fixed absolute address, and the value is the top memory address
gEfiMdeModulePkgTokenSpaceGuid.PcdLoadModuleAtFixAddressEnable|0|UINT64|0x30001015 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) ## 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. # 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 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. ## Maximun number of performance log entries during PEI phase.
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries|40|UINT8|0x0001002f gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries|40|UINT8|0x0001002f
@ -897,6 +897,10 @@
## This PCD specifies whether 1G page table is enabled. ## This PCD specifies whether 1G page table is enabled.
gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable|FALSE|BOOLEAN|0x0001005E 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 ## 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. # the extension FPDT boot records got after ReadyToBoot and before ExitBootService.
gEfiMdeModulePkgTokenSpaceGuid.PcdExtFpdtBootRecordPadSize|0x0|UINT32|0x0001005F gEfiMdeModulePkgTokenSpaceGuid.PcdExtFpdtBootRecordPadSize|0x0|UINT32|0x0001005F

View File

@ -2,7 +2,7 @@
This code produces the Smbios protocol. It also responsible for constructing This code produces the Smbios protocol. It also responsible for constructing
SMBIOS table into system table. SMBIOS table into system table.
Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR> Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -49,11 +49,11 @@ SMBIOS_TABLE_ENTRY_POINT EntryPointStructureData = {
// //
// MajorVersion // MajorVersion
// //
(UINT8) (FixedPcdGet16 (PcdSmbiosVersion) >> 8), 0,
// //
// MinorVersion // MinorVersion
// //
(UINT8) (FixedPcdGet16 (PcdSmbiosVersion) & 0x00ff), 0,
// //
// MaxStructureSize, TO BE FILLED // MaxStructureSize, TO BE FILLED
// //
@ -101,8 +101,7 @@ SMBIOS_TABLE_ENTRY_POINT EntryPointStructureData = {
// //
// SmbiosBcdRevision // SmbiosBcdRevision
// //
(UINT8) ((FixedPcdGet16 (PcdSmbiosVersion) >> 4) & 0xf0) 0
| (UINT8) (FixedPcdGet16 (PcdSmbiosVersion) & 0x0f)
}; };
@ -1079,8 +1078,11 @@ SmbiosDriverEntryPoint (
mPrivateData.Smbios.UpdateString = SmbiosUpdateString; mPrivateData.Smbios.UpdateString = SmbiosUpdateString;
mPrivateData.Smbios.Remove = SmbiosRemove; mPrivateData.Smbios.Remove = SmbiosRemove;
mPrivateData.Smbios.GetNext = SmbiosGetNext; mPrivateData.Smbios.GetNext = SmbiosGetNext;
mPrivateData.Smbios.MajorVersion = (UINT8) (FixedPcdGet16 (PcdSmbiosVersion) >> 8); mPrivateData.Smbios.MajorVersion = (UINT8) (PcdGet16 (PcdSmbiosVersion) >> 8);
mPrivateData.Smbios.MinorVersion = (UINT8) (FixedPcdGet16 (PcdSmbiosVersion) & 0x00ff); 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.DataListHead);
InitializeListHead (&mPrivateData.AllocatedHandleListHead); InitializeListHead (&mPrivateData.AllocatedHandleListHead);

View File

@ -2,7 +2,7 @@
# Component description file for Smbios module. # Component description file for Smbios module.
# #
# This driver initializes and installs the SMBIOS protocol. # This driver initializes and installs the SMBIOS protocol.
# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -54,7 +54,7 @@
gEfiEventReadyToBootGuid # PROTOCOL ALWAYS_CONSUMED gEfiEventReadyToBootGuid # PROTOCOL ALWAYS_CONSUMED
gEfiSmbiosTableGuid # PROTOCOL ALWAYS_CONSUMED gEfiSmbiosTableGuid # PROTOCOL ALWAYS_CONSUMED
[FixedPcd] [Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion
[Depex] [Depex]