summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-01-09 06:26:42 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-01-09 06:26:42 +0000
commite56187913724379012649c0411668f94ac2ffd9f (patch)
treef455b0004585ba7f2b38fd51ec4e1c82a2e58e8b /MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c
parentb3ff502f6dbbd343c75859ee04de4ee1683cdecc (diff)
downloadedk2-platforms-e56187913724379012649c0411668f94ac2ffd9f.tar.xz
Add INF extension Information
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7228 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c')
-rw-r--r--MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c
index f028b717c9..8954a5fd8e 100644
--- a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c
+++ b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c
@@ -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;