Remove unnecessary use of FixedPcdxxx() functions and [FixedPcd] INF sections. These should only be used for PCDs that are used to pre-init global variables, pre-init global structures, or size arrays.
Do some minor clean ups to INF files git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9868 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Sample ACPI Platform Driver
|
||||
|
||||
Copyright (c) 2008 - 2009, Intel Corporation<BR>
|
||||
Copyright (c) 2008 - 2010, Intel Corporation<BR>
|
||||
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
|
||||
@@ -93,7 +93,7 @@ LocateFvInstanceWithTables (
|
||||
//
|
||||
Status = FvInstance->ReadFile (
|
||||
FvInstance,
|
||||
(EFI_GUID*)FixedPcdGetPtr (PcdAcpiTableStorageFile),
|
||||
(EFI_GUID*)PcdGetPtr (PcdAcpiTableStorageFile),
|
||||
NULL,
|
||||
&Size,
|
||||
&FileType,
|
||||
@@ -207,7 +207,7 @@ AcpiPlatformEntryPoint (
|
||||
|
||||
Status = FwVol->ReadSection (
|
||||
FwVol,
|
||||
(EFI_GUID*)FixedPcdGetPtr (PcdAcpiTableStorageFile),
|
||||
(EFI_GUID*)PcdGetPtr (PcdAcpiTableStorageFile),
|
||||
EFI_SECTION_RAW,
|
||||
Instance,
|
||||
(VOID**) &CurrentTable,
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#/** @file
|
||||
# Sample ACPI Platform Driver
|
||||
#
|
||||
# Copyright (c) 2008 - 2009, Intel Corporation. <BR>
|
||||
# Copyright (c) 2008 - 2010, Intel Corporation. <BR>
|
||||
# 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
|
||||
@@ -18,8 +18,6 @@
|
||||
FILE_GUID = cb933912-df8f-4305-b1f9-7b44fa11395c
|
||||
MODULE_TYPE = DXE_DRIVER
|
||||
VERSION_STRING = 1.0
|
||||
EDK_RELEASE_VERSION = 0x00020000
|
||||
EFI_SPECIFICATION_VERSION = 0x00020000
|
||||
ENTRY_POINT = AcpiPlatformEntryPoint
|
||||
|
||||
#
|
||||
@@ -28,7 +26,7 @@
|
||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
||||
#
|
||||
|
||||
[Sources.common]
|
||||
[Sources]
|
||||
AcpiPlatform.c
|
||||
|
||||
[Packages]
|
||||
@@ -47,7 +45,7 @@
|
||||
[Protocols]
|
||||
gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||
|
||||
[FixedPcd.common]
|
||||
[Pcd]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiTableStorageFile
|
||||
|
||||
[Depex]
|
||||
|
@@ -598,7 +598,7 @@ TerminalDriverBindingStart (
|
||||
goto Error;
|
||||
}
|
||||
|
||||
TerminalType = FixedPcdGet8 (PcdDefaultTerminalType);
|
||||
TerminalType = PcdGet8 (PcdDefaultTerminalType);
|
||||
//
|
||||
// Must be between PCANSITYPE (0) and VTUTF8TYPE (3)
|
||||
//
|
||||
|
@@ -276,7 +276,7 @@
|
||||
# - Variable GUID for HII type PCD
|
||||
# - Token space GUID for dynamicex type PCD
|
||||
#
|
||||
# Copyright (c) 2006 - 2009, Intel Corporation
|
||||
# Copyright (c) 2006 - 2010, 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
|
||||
@@ -303,7 +303,7 @@
|
||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
||||
#
|
||||
|
||||
[Sources.common]
|
||||
[Sources]
|
||||
Pcd.c
|
||||
Service.c
|
||||
Service.h
|
||||
@@ -331,7 +331,7 @@
|
||||
gPcdProtocolGuid ## PRODUCES
|
||||
gEfiPcdProtocolGuid ## PRODUCES
|
||||
|
||||
[FixedPcd.common]
|
||||
[Pcd]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress
|
||||
|
||||
[Depex]
|
||||
|
@@ -119,7 +119,7 @@ GetWorker (
|
||||
switch (LocalTokenNumber & PCD_TYPE_ALL_SET) {
|
||||
case PCD_TYPE_VPD:
|
||||
VpdHead = (VPD_HEAD *) ((UINT8 *) PcdDb + Offset);
|
||||
RetPtr = (VOID *) (UINTN) (FixedPcdGet32(PcdVpdBaseAddress) + VpdHead->Offset);
|
||||
RetPtr = (VOID *) (UINTN) (PcdGet32 (PcdVpdBaseAddress) + VpdHead->Offset);
|
||||
break;
|
||||
|
||||
case PCD_TYPE_HII:
|
||||
|
@@ -271,7 +271,7 @@
|
||||
# - Variable GUID for HII type PCD
|
||||
# - Token space GUID for dynamicex type PCD
|
||||
#
|
||||
# Copyright (c) 2006 - 2009, Intel Corporation
|
||||
# Copyright (c) 2006 - 2010, 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
|
||||
@@ -298,7 +298,7 @@
|
||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC (EBC is for build only)
|
||||
#
|
||||
|
||||
[Sources.common]
|
||||
[Sources]
|
||||
Service.c
|
||||
Service.h
|
||||
Pcd.c
|
||||
@@ -328,7 +328,7 @@
|
||||
[FeaturePcd]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiFullPcdDatabaseEnable
|
||||
|
||||
[FixedPcd]
|
||||
[Pcd]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPcdCallBackNumberPerPcdEntry || PcdPeiFullPcdDatabaseEnable
|
||||
|
||||
|
@@ -87,13 +87,13 @@ PeiRegisterCallBackWorker (
|
||||
ASSERT (GuidHob != NULL);
|
||||
|
||||
CallbackTable = GET_GUID_HOB_DATA (GuidHob);
|
||||
CallbackTable = CallbackTable + (TokenNumber * FixedPcdGet32(PcdMaxPeiPcdCallBackNumberPerPcdEntry));
|
||||
CallbackTable = CallbackTable + (TokenNumber * PcdGet32 (PcdMaxPeiPcdCallBackNumberPerPcdEntry));
|
||||
|
||||
Compare = Register? NULL: CallBackFunction;
|
||||
Assign = Register? CallBackFunction: NULL;
|
||||
|
||||
|
||||
for (Idx = 0; Idx < FixedPcdGet32(PcdMaxPeiPcdCallBackNumberPerPcdEntry); Idx++) {
|
||||
for (Idx = 0; Idx < PcdGet32 (PcdMaxPeiPcdCallBackNumberPerPcdEntry); Idx++) {
|
||||
if (CallbackTable[Idx] == Compare) {
|
||||
CallbackTable[Idx] = Assign;
|
||||
return EFI_SUCCESS;
|
||||
@@ -126,7 +126,7 @@ BuildPcdDatabase (
|
||||
|
||||
CopyMem (&Database->Init, &gPEIPcdDbInit, sizeof (gPEIPcdDbInit));
|
||||
|
||||
SizeOfCallbackFnTable = PEI_LOCAL_TOKEN_NUMBER * sizeof (PCD_PPI_CALLBACK) * FixedPcdGet32(PcdMaxPeiPcdCallBackNumberPerPcdEntry);
|
||||
SizeOfCallbackFnTable = PEI_LOCAL_TOKEN_NUMBER * sizeof (PCD_PPI_CALLBACK) * PcdGet32 (PcdMaxPeiPcdCallBackNumberPerPcdEntry);
|
||||
|
||||
CallbackFnTable = BuildGuidHob (&gEfiCallerIdGuid, SizeOfCallbackFnTable);
|
||||
|
||||
@@ -300,9 +300,9 @@ InvokeCallbackOnSet (
|
||||
|
||||
CallbackTable = GET_GUID_HOB_DATA (GuidHob);
|
||||
|
||||
CallbackTable += (TokenNumber * FixedPcdGet32(PcdMaxPeiPcdCallBackNumberPerPcdEntry));
|
||||
CallbackTable += (TokenNumber * PcdGet32 (PcdMaxPeiPcdCallBackNumberPerPcdEntry));
|
||||
|
||||
for (Idx = 0; Idx < FixedPcdGet32(PcdMaxPeiPcdCallBackNumberPerPcdEntry); Idx++) {
|
||||
for (Idx = 0; Idx < PcdGet32 (PcdMaxPeiPcdCallBackNumberPerPcdEntry); Idx++) {
|
||||
if (CallbackTable[Idx] != NULL) {
|
||||
CallbackTable[Idx] (Guid,
|
||||
(Guid == NULL)? TokenNumber: ExTokenNumber,
|
||||
@@ -621,7 +621,7 @@ GetWorker (
|
||||
{
|
||||
VPD_HEAD *VpdHead;
|
||||
VpdHead = (VPD_HEAD *) ((UINT8 *)PeiPcdDb + Offset);
|
||||
return (VOID *) (UINTN) (FixedPcdGet32(PcdVpdBaseAddress) + VpdHead->Offset);
|
||||
return (VOID *) (UINTN) (PcdGet32 (PcdVpdBaseAddress) + VpdHead->Offset);
|
||||
}
|
||||
|
||||
case PCD_TYPE_HII:
|
||||
|
@@ -3,7 +3,7 @@
|
||||
Emulation Variable services operate on the runtime volatile memory.
|
||||
The nonvolatile variable space doesn't exist.
|
||||
|
||||
Copyright (c) 2006 - 2008, Intel Corporation
|
||||
Copyright (c) 2006 - 2010, 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
|
||||
@@ -767,9 +767,9 @@ UpdateVariable (
|
||||
if ((Attributes & EFI_VARIABLE_NON_VOLATILE) != 0) {
|
||||
NonVolatileVarableStoreSize = ((VARIABLE_STORE_HEADER *)(UINTN)(Global->NonVolatileVariableBase))->Size;
|
||||
if ((((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) != 0)
|
||||
&& ((VarSize + mVariableModuleGlobal->HwErrVariableTotalSize) > FixedPcdGet32(PcdHwErrStorageSize)))
|
||||
&& ((VarSize + mVariableModuleGlobal->HwErrVariableTotalSize) > PcdGet32 (PcdHwErrStorageSize)))
|
||||
|| (((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == 0)
|
||||
&& ((VarSize + mVariableModuleGlobal->CommonVariableTotalSize) > NonVolatileVarableStoreSize - sizeof (VARIABLE_STORE_HEADER) - FixedPcdGet32(PcdHwErrStorageSize)))) {
|
||||
&& ((VarSize + mVariableModuleGlobal->CommonVariableTotalSize) > NonVolatileVarableStoreSize - sizeof (VARIABLE_STORE_HEADER) - PcdGet32 (PcdHwErrStorageSize)))) {
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
goto Done;
|
||||
}
|
||||
@@ -1166,12 +1166,12 @@ EmuSetVariable (
|
||||
}
|
||||
//
|
||||
// The size of the VariableName, including the Unicode Null in bytes plus
|
||||
// the DataSize is limited to maximum size of FixedPcdGet32(PcdMaxHardwareErrorVariableSize)
|
||||
// bytes for HwErrRec, and FixedPcdGet32(PcdMaxVariableSize) bytes for the others.
|
||||
// the DataSize is limited to maximum size of PcdGet32 (PcdMaxHardwareErrorVariableSize)
|
||||
// bytes for HwErrRec, and PcdGet32 (PcdMaxVariableSize) bytes for the others.
|
||||
//
|
||||
if ((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {
|
||||
if ((DataSize > FixedPcdGet32(PcdMaxHardwareErrorVariableSize)) ||
|
||||
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > FixedPcdGet32(PcdMaxHardwareErrorVariableSize))) {
|
||||
if ((DataSize > PcdGet32 (PcdMaxHardwareErrorVariableSize)) ||
|
||||
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > PcdGet32 (PcdMaxHardwareErrorVariableSize))) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
//
|
||||
@@ -1183,10 +1183,10 @@ EmuSetVariable (
|
||||
} else {
|
||||
//
|
||||
// The size of the VariableName, including the Unicode Null in bytes plus
|
||||
// the DataSize is limited to maximum size of FixedPcdGet32(PcdMaxVariableSize) bytes.
|
||||
// the DataSize is limited to maximum size of PcdGet32 (PcdMaxVariableSize) bytes.
|
||||
//
|
||||
if ((DataSize > FixedPcdGet32(PcdMaxVariableSize)) ||
|
||||
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > FixedPcdGet32(PcdMaxVariableSize))) {
|
||||
if ((DataSize > PcdGet32 (PcdMaxVariableSize)) ||
|
||||
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > PcdGet32 (PcdMaxVariableSize))) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
@@ -1301,18 +1301,18 @@ EmuQueryVariableInfo (
|
||||
// Harware error record variable needs larger size.
|
||||
//
|
||||
if ((Attributes & (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_HARDWARE_ERROR_RECORD)) == (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_HARDWARE_ERROR_RECORD)) {
|
||||
*MaximumVariableStorageSize = FixedPcdGet32(PcdHwErrStorageSize);
|
||||
*MaximumVariableSize = FixedPcdGet32(PcdMaxHardwareErrorVariableSize) - sizeof (VARIABLE_HEADER);
|
||||
*MaximumVariableStorageSize = PcdGet32 (PcdHwErrStorageSize);
|
||||
*MaximumVariableSize = PcdGet32 (PcdMaxHardwareErrorVariableSize) - sizeof (VARIABLE_HEADER);
|
||||
} else {
|
||||
if ((Attributes & EFI_VARIABLE_NON_VOLATILE) != 0) {
|
||||
ASSERT (FixedPcdGet32(PcdHwErrStorageSize) < VariableStoreHeader->Size);
|
||||
*MaximumVariableStorageSize = VariableStoreHeader->Size - sizeof (VARIABLE_STORE_HEADER) - FixedPcdGet32(PcdHwErrStorageSize);
|
||||
ASSERT (PcdGet32 (PcdHwErrStorageSize) < VariableStoreHeader->Size);
|
||||
*MaximumVariableStorageSize = VariableStoreHeader->Size - sizeof (VARIABLE_STORE_HEADER) - PcdGet32 (PcdHwErrStorageSize);
|
||||
}
|
||||
|
||||
//
|
||||
// Let *MaximumVariableSize be FixedPcdGet32(PcdMaxVariableSize) with the exception of the variable header size.
|
||||
// Let *MaximumVariableSize be PcdGet32 (PcdMaxVariableSize) with the exception of the variable header size.
|
||||
//
|
||||
*MaximumVariableSize = FixedPcdGet32(PcdMaxVariableSize) - sizeof (VARIABLE_HEADER);
|
||||
*MaximumVariableSize = PcdGet32 (PcdMaxVariableSize) - sizeof (VARIABLE_HEADER);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1392,15 +1392,13 @@ InitializeVariableStore (
|
||||
// ensure that the value of PcdHwErrStorageSize is less than or equal to the value of
|
||||
// PcdVariableStoreSize.
|
||||
//
|
||||
ASSERT (FixedPcdGet32(PcdHwErrStorageSize) <= FixedPcdGet32(PcdVariableStoreSize));
|
||||
ASSERT (PcdGet32 (PcdHwErrStorageSize) <= PcdGet32 (PcdVariableStoreSize));
|
||||
|
||||
//
|
||||
// Allocate memory for variable store.
|
||||
//
|
||||
if (VolatileStore || (PcdGet64 (PcdEmuVariableNvStoreReserved) == 0)) {
|
||||
VariableStore = (VARIABLE_STORE_HEADER *) AllocateRuntimePool (
|
||||
FixedPcdGet32(PcdVariableStoreSize)
|
||||
);
|
||||
VariableStore = (VARIABLE_STORE_HEADER *) AllocateRuntimePool (PcdGet32 (PcdVariableStoreSize));
|
||||
} else {
|
||||
//
|
||||
// A memory location has been reserved for the NV variable store. Certain
|
||||
@@ -1411,7 +1409,7 @@ InitializeVariableStore (
|
||||
(VARIABLE_STORE_HEADER *)(VOID*)(UINTN)
|
||||
PcdGet64 (PcdEmuVariableNvStoreReserved);
|
||||
if (
|
||||
(VariableStore->Size == FixedPcdGet32(PcdVariableStoreSize)) &&
|
||||
(VariableStore->Size == PcdGet32 (PcdVariableStoreSize)) &&
|
||||
(VariableStore->Format == VARIABLE_STORE_FORMATTED) &&
|
||||
(VariableStore->State == VARIABLE_STORE_HEALTHY)
|
||||
) {
|
||||
@@ -1429,7 +1427,7 @@ InitializeVariableStore (
|
||||
}
|
||||
|
||||
if (FullyInitializeStore) {
|
||||
SetMem (VariableStore, FixedPcdGet32(PcdVariableStoreSize), 0xff);
|
||||
SetMem (VariableStore, PcdGet32 (PcdVariableStoreSize), 0xff);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1439,7 +1437,7 @@ InitializeVariableStore (
|
||||
InitializeLocationForLastVariableOffset (VariableStore, LastVariableOffset);
|
||||
|
||||
CopyGuid (&VariableStore->Signature, &gEfiVariableGuid);
|
||||
VariableStore->Size = FixedPcdGet32(PcdVariableStoreSize);
|
||||
VariableStore->Size = PcdGet32 (PcdVariableStoreSize);
|
||||
VariableStore->Format = VARIABLE_STORE_FORMATTED;
|
||||
VariableStore->State = VARIABLE_STORE_HEALTHY;
|
||||
VariableStore->Reserved = 0;
|
||||
|
@@ -3,7 +3,7 @@
|
||||
Implement all four UEFI Runtime Variable services for the nonvolatile
|
||||
and volatile storage space and install variable architecture protocol.
|
||||
|
||||
Copyright (c) 2006 - 2009, Intel Corporation
|
||||
Copyright (c) 2006 - 2010, 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
|
||||
@@ -1475,7 +1475,7 @@ UpdateVariable (
|
||||
// as a temporary storage.
|
||||
//
|
||||
NextVariable = GetEndPointer ((VARIABLE_STORE_HEADER *) ((UINTN) mVariableModuleGlobal->VariableGlobal.VolatileVariableBase));
|
||||
ScratchSize = MAX(FixedPcdGet32(PcdMaxVariableSize), FixedPcdGet32(PcdMaxHardwareErrorVariableSize));
|
||||
ScratchSize = MAX (PcdGet32 (PcdMaxVariableSize), PcdGet32 (PcdMaxHardwareErrorVariableSize));
|
||||
|
||||
SetMem (NextVariable, ScratchSize, 0xff);
|
||||
|
||||
@@ -1519,9 +1519,9 @@ UpdateVariable (
|
||||
Volatile = FALSE;
|
||||
NonVolatileVarableStoreSize = ((VARIABLE_STORE_HEADER *)(UINTN)(mVariableModuleGlobal->VariableGlobal.NonVolatileVariableBase))->Size;
|
||||
if ((((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) != 0)
|
||||
&& ((VarSize + mVariableModuleGlobal->HwErrVariableTotalSize) > FixedPcdGet32(PcdHwErrStorageSize)))
|
||||
&& ((VarSize + mVariableModuleGlobal->HwErrVariableTotalSize) > PcdGet32 (PcdHwErrStorageSize)))
|
||||
|| (((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == 0)
|
||||
&& ((VarSize + mVariableModuleGlobal->CommonVariableTotalSize) > NonVolatileVarableStoreSize - sizeof (VARIABLE_STORE_HEADER) - FixedPcdGet32(PcdHwErrStorageSize)))) {
|
||||
&& ((VarSize + mVariableModuleGlobal->CommonVariableTotalSize) > NonVolatileVarableStoreSize - sizeof (VARIABLE_STORE_HEADER) - PcdGet32 (PcdHwErrStorageSize)))) {
|
||||
if (EfiAtRuntime ()) {
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
goto Done;
|
||||
@@ -1538,9 +1538,9 @@ UpdateVariable (
|
||||
// If still no enough space, return out of resources
|
||||
//
|
||||
if ((((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) != 0)
|
||||
&& ((VarSize + mVariableModuleGlobal->HwErrVariableTotalSize) > FixedPcdGet32(PcdHwErrStorageSize)))
|
||||
&& ((VarSize + mVariableModuleGlobal->HwErrVariableTotalSize) > PcdGet32 (PcdHwErrStorageSize)))
|
||||
|| (((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == 0)
|
||||
&& ((VarSize + mVariableModuleGlobal->CommonVariableTotalSize) > NonVolatileVarableStoreSize - sizeof (VARIABLE_STORE_HEADER) - FixedPcdGet32(PcdHwErrStorageSize)))) {
|
||||
&& ((VarSize + mVariableModuleGlobal->CommonVariableTotalSize) > NonVolatileVarableStoreSize - sizeof (VARIABLE_STORE_HEADER) - PcdGet32 (PcdHwErrStorageSize)))) {
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
goto Done;
|
||||
}
|
||||
@@ -1943,12 +1943,12 @@ RuntimeServiceSetVariable (
|
||||
|
||||
//
|
||||
// The size of the VariableName, including the Unicode Null in bytes plus
|
||||
// the DataSize is limited to maximum size of FixedPcdGet32(PcdMaxHardwareErrorVariableSize)
|
||||
// bytes for HwErrRec, and FixedPcdGet32(PcdMaxVariableSize) bytes for the others.
|
||||
// the DataSize is limited to maximum size of PcdGet32 (PcdMaxHardwareErrorVariableSize)
|
||||
// bytes for HwErrRec, and PcdGet32 (PcdMaxVariableSize) bytes for the others.
|
||||
//
|
||||
if ((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {
|
||||
if ((DataSize > FixedPcdGet32(PcdMaxHardwareErrorVariableSize)) ||
|
||||
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > FixedPcdGet32(PcdMaxHardwareErrorVariableSize))) {
|
||||
if ((DataSize > PcdGet32 (PcdMaxHardwareErrorVariableSize)) ||
|
||||
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > PcdGet32 (PcdMaxHardwareErrorVariableSize))) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
//
|
||||
@@ -1960,10 +1960,10 @@ RuntimeServiceSetVariable (
|
||||
} else {
|
||||
//
|
||||
// The size of the VariableName, including the Unicode Null in bytes plus
|
||||
// the DataSize is limited to maximum size of FixedPcdGet32(PcdMaxVariableSize) bytes.
|
||||
// the DataSize is limited to maximum size of PcdGet32 (PcdMaxVariableSize) bytes.
|
||||
//
|
||||
if ((DataSize > FixedPcdGet32(PcdMaxVariableSize)) ||
|
||||
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > FixedPcdGet32(PcdMaxVariableSize))) {
|
||||
if ((DataSize > PcdGet32 (PcdMaxVariableSize)) ||
|
||||
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > PcdGet32 (PcdMaxVariableSize))) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
@@ -2091,18 +2091,18 @@ RuntimeServiceQueryVariableInfo (
|
||||
// Harware error record variable needs larger size.
|
||||
//
|
||||
if ((Attributes & (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_HARDWARE_ERROR_RECORD)) == (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_HARDWARE_ERROR_RECORD)) {
|
||||
*MaximumVariableStorageSize = FixedPcdGet32(PcdHwErrStorageSize);
|
||||
*MaximumVariableSize = FixedPcdGet32(PcdMaxHardwareErrorVariableSize) - sizeof (VARIABLE_HEADER);
|
||||
*MaximumVariableStorageSize = PcdGet32 (PcdHwErrStorageSize);
|
||||
*MaximumVariableSize = PcdGet32 (PcdMaxHardwareErrorVariableSize) - sizeof (VARIABLE_HEADER);
|
||||
} else {
|
||||
if ((Attributes & EFI_VARIABLE_NON_VOLATILE) != 0) {
|
||||
ASSERT (FixedPcdGet32(PcdHwErrStorageSize) < VariableStoreHeader->Size);
|
||||
*MaximumVariableStorageSize = VariableStoreHeader->Size - sizeof (VARIABLE_STORE_HEADER) - FixedPcdGet32(PcdHwErrStorageSize);
|
||||
ASSERT (PcdGet32 (PcdHwErrStorageSize) < VariableStoreHeader->Size);
|
||||
*MaximumVariableStorageSize = VariableStoreHeader->Size - sizeof (VARIABLE_STORE_HEADER) - PcdGet32 (PcdHwErrStorageSize);
|
||||
}
|
||||
|
||||
//
|
||||
// Let *MaximumVariableSize be FixedPcdGet32(PcdMaxVariableSize) with the exception of the variable header size.
|
||||
// Let *MaximumVariableSize be PcdGet32 (PcdMaxVariableSize) with the exception of the variable header size.
|
||||
//
|
||||
*MaximumVariableSize = FixedPcdGet32(PcdMaxVariableSize) - sizeof (VARIABLE_HEADER);
|
||||
*MaximumVariableSize = PcdGet32 (PcdMaxVariableSize) - sizeof (VARIABLE_HEADER);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -2259,19 +2259,19 @@ VariableCommonInitialize (
|
||||
// ensure that the value of PcdHwErrStorageSize is less than or equal to the value of
|
||||
// PcdFlashNvStorageVariableSize.
|
||||
//
|
||||
ASSERT (FixedPcdGet32(PcdHwErrStorageSize) <= FixedPcdGet32(PcdFlashNvStorageVariableSize));
|
||||
ASSERT (PcdGet32 (PcdHwErrStorageSize) <= PcdGet32 (PcdFlashNvStorageVariableSize));
|
||||
|
||||
//
|
||||
// Allocate memory for volatile variable store, note that there is a scratch space to store scratch data.
|
||||
//
|
||||
ScratchSize = MAX(FixedPcdGet32(PcdMaxVariableSize), FixedPcdGet32(PcdMaxHardwareErrorVariableSize));
|
||||
VolatileVariableStore = AllocateRuntimePool (FixedPcdGet32(PcdVariableStoreSize) + ScratchSize);
|
||||
ScratchSize = MAX (PcdGet32 (PcdMaxVariableSize), PcdGet32 (PcdMaxHardwareErrorVariableSize));
|
||||
VolatileVariableStore = AllocateRuntimePool (PcdGet32 (PcdVariableStoreSize) + ScratchSize);
|
||||
if (VolatileVariableStore == NULL) {
|
||||
FreePool (mVariableModuleGlobal);
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
SetMem (VolatileVariableStore, FixedPcdGet32(PcdVariableStoreSize) + ScratchSize, 0xff);
|
||||
SetMem (VolatileVariableStore, PcdGet32 (PcdVariableStoreSize) + ScratchSize, 0xff);
|
||||
|
||||
//
|
||||
// Variable Specific Data
|
||||
@@ -2281,7 +2281,7 @@ VariableCommonInitialize (
|
||||
mVariableModuleGlobal->FvbInstance = FvbProtocol;
|
||||
|
||||
CopyGuid (&VolatileVariableStore->Signature, &gEfiVariableGuid);
|
||||
VolatileVariableStore->Size = FixedPcdGet32(PcdVariableStoreSize);
|
||||
VolatileVariableStore->Size = PcdGet32 (PcdVariableStoreSize);
|
||||
VolatileVariableStore->Format = VARIABLE_STORE_FORMATTED;
|
||||
VolatileVariableStore->State = VARIABLE_STORE_HEALTHY;
|
||||
VolatileVariableStore->Reserved = 0;
|
||||
|
Reference in New Issue
Block a user