Add INF extension Information

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7228 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4
2009-01-09 06:26:42 +00:00
parent b3ff502f6d
commit e561879137
22 changed files with 164 additions and 190 deletions

View File

@@ -2,7 +2,7 @@
#
# Capsule Runtime Drivers produces two UEFI capsule runtime services.
# (UpdateCapsule, QueryCapsuleCapabilities)
# It installs the Capsule Architectural Protocol (EDKII definition) to signify
# It installs the Capsule Architectural Protocol (EDKII extension definition) to signify
# the capsule runtime services are ready.
#
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
@@ -47,10 +47,10 @@
UefiRuntimeLib
[Guids]
gEfiCapsuleVendorGuid # Produce variable L"CapsuleUpdateData" for capsule updated data
gEfiCapsuleVendorGuid ## SOMETIMES_PRODUCED (Process across reset capsule image) ## Variable:L"CapsuleUpdateData" for capsule updated data
[Protocols]
gEfiCapsuleArchProtocolGuid # PROTOCOL ALWAYS_PRODUCED
gEfiCapsuleArchProtocolGuid ## PRODUCED
[FeaturePcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset
@@ -60,4 +60,4 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule
[Depex]
gEfiVariableWriteArchProtocolGuid # Depends on variable write functionality to produce capsule data variable
gEfiVariableWriteArchProtocolGuid ## Depends on variable write functionality to produce capsule data variable

View File

@@ -50,11 +50,11 @@
DevicePathLib
[Guids]
gEfiSystemNvDataFvGuid # ALWAYS_CONSUMED, Signature of Working Space Header
gEfiSystemNvDataFvGuid ## CONSUMED ## FV Signature of Working Space Header
[Protocols]
gEfiFirmwareVolumeBlockProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiFaultTolerantWriteLiteProtocolGuid # PROTOCOL ALWAYS_PRODUCED
gEfiFirmwareVolumeBlockProtocolGuid ## CONSUMED
gEfiFaultTolerantWriteLiteProtocolGuid ## PRODUCED
[Pcd.common]
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize

View File

@@ -47,13 +47,13 @@
DebugLib
[Guids]
gPcdPeiCallbackFnTableHobGuid # ALWAYS_PRODUCED Hob: GUID_EXTENSION
gPcdDataBaseHobGuid # ALWAYS_PRODUCED Hob: GUID_EXTENSION
gPcdPeiCallbackFnTableHobGuid ## RPIVATE ## Hob
gPcdDataBaseHobGuid ## PRODUCED ## Hob
gPcdDataBaseHobGuid ## CONSUMED ## Hob
[Ppis]
gEfiPeiReadOnlyVariable2PpiGuid # PPI ALWAYS_CONSUMED
gPcdPpiGuid # PPI ALWAYS_PRODUCED
gEfiPeiReadOnlyVariable2PpiGuid ## CONSUMED
gPcdPpiGuid ## PRODUCED
[FeaturePcd.common]
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiPcdDatabaseSetEnabled

View File

@@ -167,9 +167,8 @@ GetHiiVariable (
&Size,
NULL
);
if (Status == EFI_BUFFER_TOO_SMALL) {
Status = PeiServicesAllocatePool (Size, &Buffer);
ASSERT_EFI_ERROR (Status);
@@ -187,7 +186,7 @@ GetHiiVariable (
*VariableData = Buffer;
return EFI_SUCCESS;
}
}
return EFI_NOT_FOUND;
}

View File

@@ -45,7 +45,7 @@
[Ppis]
gEfiPciCfg2PpiGuid # PPI ALWAYS_PRODUCED
gEfiPciCfg2PpiGuid ## PRODUCED
[Depex]
TRUE

View File

@@ -1,20 +1,5 @@
/** @file
Copyright (c) 2007 - 2008, 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PlatOverMngr.c
Abstract:
A UI application to offer a UI interface in device manager to let user configue
platform override protocol to override the default algorithm for matching
drivers to controllers.
@@ -27,6 +12,15 @@ Abstract:
4. The UI application save all the mapping info in NV variables which will be consumed
by platform override protocol driver to publish the platform override protocol.
Copyright (c) 2007 - 2008, 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include <PiDxe.h>
@@ -119,30 +113,33 @@ ConvertComponentNameSupportLanguage (
IN CHAR8 *Language
)
{
CHAR8 *LangCode;
LangCode = NULL;
CHAR8 *LangCode;
LangCode = NULL;
//
// check the input language is English
// Check the input language is English
//
if (AsciiStrnCmp (Language, "en-", 3) != 0) {
return NULL;
}
//
// Convert Language string from RFC 3066 to ISO 639-2
//
LangCode = AllocateZeroPool(4);
AsciiStrCpy (LangCode, "eng");
//
// Check whether the converted language is supported in the SupportedLanguages list.
// Check SupportedLanguages format
//
if (AsciiStrStr (SupportedLanguages, LangCode) == NULL) {
FreePool (LangCode);
return NULL;
if (AsciiStrStr (SupportedLanguages, "en-") != NULL) {
//
// Create RFC 3066 language
//
LangCode = AllocateZeroPool(AsciiStrSize (Language));
AsciiStrCpy (LangCode, Language);
} else if (AsciiStrStr (SupportedLanguages, "en") != NULL) {
//
// Create ISO 639-2 Language
//
LangCode = AllocateZeroPool(4);
AsciiStrCpy (LangCode, "eng");
}
return LangCode;
}
@@ -193,12 +190,14 @@ GetComponentName (
if (ComponentName != NULL) {
if (ComponentName->GetDriverName != NULL) {
SupportedLanguage = ConvertComponentNameSupportLanguage (ComponentName->SupportedLanguages, mLanguage);
Status = ComponentName->GetDriverName (
ComponentName,
SupportedLanguage,
&DriverName
);
FreePool (SupportedLanguage);
if (SupportedLanguage != NULL) {
Status = ComponentName->GetDriverName (
ComponentName,
SupportedLanguage,
&DriverName
);
FreePool (SupportedLanguage);
}
}
} else if (ComponentName2 != NULL) {
if (ComponentName2->GetDriverName != NULL) {
@@ -555,7 +554,10 @@ GetDriverBindingHandleFromImageHandle (
if (EFI_ERROR (Status) || (DriverBindingHandleCount == 0)) {
return NULL;
}
//
// Get the first Driver Binding handle which has the specific image handle.
//
for (Index = 0; Index < DriverBindingHandleCount; Index++) {
DriverBindingInterface = NULL;
Status = gBS->OpenProtocol (
@@ -576,9 +578,6 @@ GetDriverBindingHandleFromImageHandle (
}
}
//
// If no Driver Binding Protocol instance is found
//
FreePool (DriverBindingHandleBuffer);
return DriverBindingHandle;
}
@@ -1301,7 +1300,7 @@ PlatOverMngrInit (
EFI_CALLBACK_INFO *CallbackInfo;
EFI_HANDLE DriverHandle;
EFI_FORM_BROWSER2_PROTOCOL *FormBrowser2;
//
// There should only be one HII protocol
//
@@ -1341,7 +1340,7 @@ PlatOverMngrInit (
//
Status = HiiLibCreateHiiDriverHandle (&DriverHandle);
if (EFI_ERROR (Status)) {
return Status;
goto Finish;
}
CallbackInfo->DriverHandle = DriverHandle;
@@ -1355,7 +1354,7 @@ PlatOverMngrInit (
&CallbackInfo->ConfigAccess
);
if (EFI_ERROR (Status)) {
return Status;
goto Finish;
}
//
@@ -1377,6 +1376,10 @@ PlatOverMngrInit (
);
FreePool (PackageList);
if (EFI_ERROR (Status)) {
goto Finish;
}
//
// Locate ConfigRouting protocol
//
@@ -1386,7 +1389,7 @@ PlatOverMngrInit (
(VOID **) &CallbackInfo->HiiConfigRouting
);
if (EFI_ERROR (Status)) {
return Status;
goto Finish;
}
//
@@ -1411,11 +1414,24 @@ PlatOverMngrInit (
NULL,
NULL
);
if (EFI_ERROR (Status)) {
goto Finish;
}
Status = HiiDatabase->RemovePackageList (HiiDatabase, CallbackInfo->RegisteredHandle);
if (EFI_ERROR (Status)) {
return Status;
goto Finish;
}
return EFI_SUCCESS;
Finish:
if (CallbackInfo->DriverHandle != NULL) {
HiiLibDestroyHiiDriverHandle (CallbackInfo->DriverHandle);
}
if (CallbackInfo != NULL) {
FreePool (CallbackInfo);
}
return EFI_SUCCESS;
return Status;
}

View File

@@ -67,21 +67,22 @@
GenericBdsLib
[Guids]
gEfiGlobalVariableGuid # Get value of variable L"PlatformLang".
# this value specifies the platform supported language string (RFC 3066)
gEfiGlobalVariableGuid ## CONSUMED ## Variable:L"PlatformLang" this variable specifies the platform supported language string (RFC 3066 format)
[Protocols]
gEfiComponentName2ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiComponentNameProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiFirmwareVolume2ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiPciIoProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiBusSpecificDriverOverrideProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiDriverBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiLoadedImageProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiLoadedImageDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiHiiDatabaseProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiFormBrowser2ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiHiiConfigRoutingProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiHiiConfigAccessProtocolGuid # PROTOCOL ALWAYS_PRODUCED
gEfiComponentName2ProtocolGuid ## SOMETIMES_CONSUMED (Get Driver Name if ComponentName2Protocol exists)
gEfiComponentNameProtocolGuid ## SOMETIMES_CONSUMED (Get Driver Name if ComponentNameProtocol exists and ComponentName2Protocol doesn't exist)
gEfiFirmwareVolume2ProtocolGuid ## SOMETIMES_CONSUMED (Get Driver Name from EFI UI section if ComponentName2Protocol and ComponentNameProtocol don't exist)
gEfiPciIoProtocolGuid ## SOMETIMES_CONSUMED (Find the PCI device if PciIo protocol is installed)
gEfiBusSpecificDriverOverrideProtocolGuid ## SOMETIMES_CONSUMED (Check whether the PCI device contains one or more efi drivers in its option rom by this protocol)
gEfiDriverBindingProtocolGuid ## SOMETIMES_CONSUMED
gEfiLoadedImageProtocolGuid ## SOMETIMES_CONSUMED
gEfiLoadedImageDevicePathProtocolGuid ## SOMETIMES_CONSUMED (Show the drivers in the second page that support DriverBindingProtocol, LoadedImageProtocol and LoadedImageDevicePathProtocol)
gEfiDevicePathProtocolGuid ## SOMETIMES_CONSUMED (Show the controller device in the first page that support DevicePathProtocol)
gEfiHiiDatabaseProtocolGuid ## CONSUMED
gEfiFormBrowser2ProtocolGuid ## CONSUMED
gEfiHiiConfigRoutingProtocolGuid ## CONSUMED
gEfiHiiConfigAccessProtocolGuid ## PRODUCED

View File

@@ -45,5 +45,5 @@
UefiBootServicesTableLib
[Protocols]
gEfiPlatformDriverOverrideProtocolGuid # ALWAYS_PRODUCED
gEfiPlatformDriverOverrideProtocolGuid ## PRODUCED

View File

@@ -39,7 +39,7 @@
DebugLib
[Protocols]
gEfiSecurityArchProtocolGuid # PROTOCOL ALWAYS_PRODUCED
gEfiSecurityArchProtocolGuid ## PRODUCED
[Depex]
TRUE

View File

@@ -118,7 +118,7 @@ GetNextVariablePtr (
VarHeader = (VARIABLE_HEADER *) (GetVariableDataPtr (Variable) + Variable->DataSize + GET_PAD_SIZE (Variable->DataSize));
if (VarHeader->StartId != VARIABLE_DATA ||
(sizeof (VARIABLE_HEADER) + VarHeader->DataSize + VarHeader->NameSize) > MAX_VARIABLE_SIZE
(sizeof (VARIABLE_HEADER) + VarHeader->DataSize + VarHeader->NameSize) > FixedPcdGet32(PcdMaxVariableSize)
) {
return NULL;
}
@@ -485,21 +485,21 @@ SetVariable (
}
//
// The size of the VariableName, including the Unicode Null in bytes plus
// the DataSize is limited to maximum size of MAX_HARDWARE_ERROR_VARIABLE_SIZE (32K)
// bytes for HwErrRec, and MAX_VARIABLE_SIZE (1024) bytes for the others.
// the DataSize is limited to maximum size of FixedPcdGet32(PcdMaxHardwareErrorVariableSize)
// bytes for HwErrRec, and FixedPcdGet32(PcdMaxVariableSize) bytes for the others.
//
if ((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {
if ((DataSize > MAX_HARDWARE_ERROR_VARIABLE_SIZE) ||
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > MAX_HARDWARE_ERROR_VARIABLE_SIZE)) {
if ((DataSize > FixedPcdGet32(PcdMaxHardwareErrorVariableSize)) ||
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > FixedPcdGet32(PcdMaxHardwareErrorVariableSize))) {
return EFI_INVALID_PARAMETER;
}
} else {
//
// The size of the VariableName, including the Unicode Null in bytes plus
// the DataSize is limited to maximum size of MAX_VARIABLE_SIZE (1024) bytes.
// the DataSize is limited to maximum size of FixedPcdGet32(PcdMaxVariableSize) bytes.
//
if ((DataSize > MAX_VARIABLE_SIZE) ||
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > MAX_VARIABLE_SIZE)) {
if ((DataSize > FixedPcdGet32(PcdMaxVariableSize)) ||
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > FixedPcdGet32(PcdMaxVariableSize))) {
return EFI_INVALID_PARAMETER;
}
}
@@ -740,15 +740,15 @@ QueryVariableInfo (
*RemainingVariableStorageSize = VariableStoreHeader->Size - sizeof (VARIABLE_STORE_HEADER);
//
// Let *MaximumVariableSize be MAX_VARIABLE_SIZE with the exception of the variable header size.
// Let *MaximumVariableSize be FixedPcdGet32(PcdMaxVariableSize) with the exception of the variable header size.
//
*MaximumVariableSize = MAX_VARIABLE_SIZE - sizeof (VARIABLE_HEADER);
*MaximumVariableSize = FixedPcdGet32(PcdMaxVariableSize) - sizeof (VARIABLE_HEADER);
//
// Harware error record variable needs larger size.
//
if ((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {
*MaximumVariableSize = MAX_HARDWARE_ERROR_VARIABLE_SIZE - sizeof (VARIABLE_HEADER);
*MaximumVariableSize = FixedPcdGet32(PcdMaxHardwareErrorVariableSize) - sizeof (VARIABLE_HEADER);
}
//
@@ -808,13 +808,13 @@ InitializeVariableStore (
// Allocate memory for volatile variable store
//
VariableStore = (VARIABLE_STORE_HEADER *) AllocateRuntimePool (
VARIABLE_STORE_SIZE
FixedPcdGet32(PcdVariableStoreSize)
);
if (NULL == VariableStore) {
return EFI_OUT_OF_RESOURCES;
}
SetMem (VariableStore, VARIABLE_STORE_SIZE, 0xff);
SetMem (VariableStore, FixedPcdGet32(PcdVariableStoreSize), 0xff);
//
// Variable Specific Data
@@ -823,7 +823,7 @@ InitializeVariableStore (
*LastVariableOffset = sizeof (VARIABLE_STORE_HEADER);
VariableStore->Signature = VARIABLE_STORE_SIGNATURE;
VariableStore->Size = VARIABLE_STORE_SIZE;
VariableStore->Size = FixedPcdGet32(PcdVariableStoreSize);
VariableStore->Format = VARIABLE_STORE_FORMATTED;
VariableStore->State = VARIABLE_STORE_HEALTHY;
VariableStore->Reserved = 0;

View File

@@ -33,18 +33,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/PcdLib.h>
#include <VariableFormat.h>
#define VARIABLE_STORE_SIZE FixedPcdGet32(PcdVariableStoreSize)
#define SCRATCH_SIZE FixedPcdGet32(PcdMaxVariableSize)
//
// Define GET_PAD_SIZE to optimize compiler
//
#if ((ALIGNMENT == 0) || (ALIGNMENT == 1))
#define GET_PAD_SIZE(a) (0)
#else
#define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))
#endif
#define GET_VARIABLE_NAME_PTR(a) (CHAR16 *) ((UINTN) (a) + sizeof (VARIABLE_HEADER))
typedef enum {

View File

@@ -30,17 +30,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <VariableFormat.h>
//
// Define GET_PAD_SIZE to optimize compiler
//
#if ((ALIGNMENT == 0) || (ALIGNMENT == 1))
#define GET_PAD_SIZE(a) (0)
#else
#define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))
#endif
#define HEADER_ALIGN(Header) (((UINTN) (Header) + HEADER_ALIGNMENT - 1) & (~(HEADER_ALIGNMENT - 1)))
typedef struct {
VARIABLE_HEADER *CurrPtr;
VARIABLE_HEADER *EndPtr;

View File

@@ -1225,21 +1225,21 @@ RuntimeServiceSetVariable (
//
// The size of the VariableName, including the Unicode Null in bytes plus
// the DataSize is limited to maximum size of MAX_HARDWARE_ERROR_VARIABLE_SIZE (32K)
// bytes for HwErrRec, and MAX_VARIABLE_SIZE (1024) bytes for the others.
// the DataSize is limited to maximum size of FixedPcdGet32(PcdMaxHardwareErrorVariableSize)
// bytes for HwErrRec, and FixedPcdGet32(PcdMaxVariableSize) bytes for the others.
//
if ((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {
if ((DataSize > MAX_HARDWARE_ERROR_VARIABLE_SIZE) ||
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > MAX_HARDWARE_ERROR_VARIABLE_SIZE)) {
if ((DataSize > FixedPcdGet32(PcdMaxHardwareErrorVariableSize)) ||
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > FixedPcdGet32(PcdMaxHardwareErrorVariableSize))) {
return EFI_INVALID_PARAMETER;
}
} else {
//
// The size of the VariableName, including the Unicode Null in bytes plus
// the DataSize is limited to maximum size of MAX_VARIABLE_SIZE (1024) bytes.
// the DataSize is limited to maximum size of FixedPcdGet32(PcdMaxVariableSize) bytes.
//
if ((DataSize > MAX_VARIABLE_SIZE) ||
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > MAX_VARIABLE_SIZE)) {
if ((DataSize > FixedPcdGet32(PcdMaxVariableSize)) ||
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > FixedPcdGet32(PcdMaxVariableSize))) {
return EFI_INVALID_PARAMETER;
}
}
@@ -1391,7 +1391,7 @@ RuntimeServiceSetVariable (
//
NextVariable = GetEndPointer ((VARIABLE_STORE_HEADER *) ((UINTN) mVariableModuleGlobal->VariableGlobal.VolatileVariableBase));
SetMem (NextVariable, SCRATCH_SIZE, 0xff);
SetMem (NextVariable, FixedPcdGet32(PcdMaxVariableSize), 0xff);
NextVariable->StartId = VARIABLE_DATA;
NextVariable->Attributes = Attributes;
@@ -1690,15 +1690,15 @@ RuntimeServiceQueryVariableInfo (
*RemainingVariableStorageSize = VariableStoreHeader->Size - sizeof (VARIABLE_STORE_HEADER);
//
// Let *MaximumVariableSize be MAX_VARIABLE_SIZE with the exception of the variable header size.
// Let *MaximumVariableSize be FixedPcdGet32(PcdMaxVariableSize) with the exception of the variable header size.
//
*MaximumVariableSize = MAX_VARIABLE_SIZE - sizeof (VARIABLE_HEADER);
*MaximumVariableSize = FixedPcdGet32(PcdMaxVariableSize) - sizeof (VARIABLE_HEADER);
//
// Harware error record variable needs larger size.
//
if ((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {
*MaximumVariableSize = MAX_HARDWARE_ERROR_VARIABLE_SIZE - sizeof (VARIABLE_HEADER);
*MaximumVariableSize = FixedPcdGet32(PcdMaxHardwareErrorVariableSize) - sizeof (VARIABLE_HEADER);
}
//
@@ -1835,13 +1835,13 @@ VariableCommonInitialize (
//
// Allocate memory for volatile variable store
//
VolatileVariableStore = AllocateRuntimePool (VARIABLE_STORE_SIZE + SCRATCH_SIZE);
VolatileVariableStore = AllocateRuntimePool (FixedPcdGet32(PcdVariableStoreSize) + FixedPcdGet32(PcdMaxVariableSize));
if (VolatileVariableStore == NULL) {
FreePool (mVariableModuleGlobal);
return EFI_OUT_OF_RESOURCES;
}
SetMem (VolatileVariableStore, VARIABLE_STORE_SIZE + SCRATCH_SIZE, 0xff);
SetMem (VolatileVariableStore, FixedPcdGet32(PcdVariableStoreSize) + FixedPcdGet32(PcdMaxVariableSize), 0xff);
//
// Variable Specific Data
@@ -1850,7 +1850,7 @@ VariableCommonInitialize (
mVariableModuleGlobal->VolatileLastVariableOffset = (UINTN) GetStartPointer (VolatileVariableStore) - (UINTN) VolatileVariableStore;
VolatileVariableStore->Signature = VARIABLE_STORE_SIGNATURE;
VolatileVariableStore->Size = VARIABLE_STORE_SIZE;
VolatileVariableStore->Size = FixedPcdGet32(PcdVariableStoreSize);
VolatileVariableStore->Format = VARIABLE_STORE_FORMATTED;
VolatileVariableStore->State = VARIABLE_STORE_HEALTHY;
VolatileVariableStore->Reserved = 0;

View File

@@ -37,25 +37,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Guid/GlobalVariable.h>
#include <VariableFormat.h>
#define VARIABLE_RECLAIM_THRESHOLD (1024)
#define VARIABLE_STORE_SIZE FixedPcdGet32(PcdVariableStoreSize)
#define SCRATCH_SIZE FixedPcdGet32(PcdMaxVariableSize)
//
// Define GET_PAD_SIZE to optimize compiler
//
#if ((ALIGNMENT == 0) || (ALIGNMENT == 1))
#define GET_PAD_SIZE(a) (0)
#else
#define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))
#endif
#define HEADER_ALIGN(Header) (((UINTN) (Header) + HEADER_ALIGNMENT - 1) & (~(HEADER_ALIGNMENT - 1)))
typedef struct {
VARIABLE_HEADER *CurrPtr;
VARIABLE_HEADER *EndPtr;