summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
diff options
context:
space:
mode:
authoryshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>2008-01-11 03:16:46 +0000
committeryshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>2008-01-11 03:16:46 +0000
commitab5f0d6d1271a293979af569a269792c491d0893 (patch)
treee8ebb9e8dcb8f48b0279aead40e6ccd428da65a4 /MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
parent9cad030bc14e706d8986ed33f0fa8b28f0828c48 (diff)
downloadedk2-platforms-ab5f0d6d1271a293979af569a269792c491d0893.tar.xz
Change C functions, xxxSizeOfVariable(), to MACRO, which can avoid the ICC compile error "Unspecific evaluated order".
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4552 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c')
-rw-r--r--MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c68
1 files changed, 7 insertions, 61 deletions
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index e1fec9d62c..d7cb0cd71c 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -367,60 +367,6 @@ Returns:
}
}
-
-UINT32
-NameSizeOfVariable (
- IN VARIABLE_HEADER *Variable
- )
-{
- //
- // Check whether the header is valid fully;
- // Tricky: The unprogramed data in FLASH equals 0xff.
- //
- if (Variable->DataSize == (UINT32) -1 ||
- Variable->Attributes == (UINT32) -1 ||
- Variable->NameSize == (UINT32) -1) {
- return 0;
- }
- return Variable->NameSize;
-}
-
-UINT32
-DataSizeOfVariable (
- IN VARIABLE_HEADER *Variable
- )
-{
- //
- // Check whether the header is valid fully;
- // Tricky: The unprogramed data in FLASH equals 0xff.
- //
- if (Variable->DataSize == (UINT32) -1 ||
- Variable->Attributes == (UINT32) -1 ||
- Variable->NameSize == (UINT32) -1) {
- return 0;
- }
- return Variable->DataSize;
-}
-
-UINT32
-AttributesOfVariable (
- IN VARIABLE_HEADER *Variable
- )
-{
-
- //
- // Check whether the header is valid fully;
- // Tricky: The unprogramed data in FLASH equals 0xff.
- //
- if (Variable->DataSize == (UINT32) -1 ||
- Variable->Attributes == (UINT32) -1 ||
- Variable->NameSize == (UINT32) -1) {
- return 0;
- }
- return Variable->Attributes;
-}
-
-
UINT8 *
GetVariableDataPtr (
IN VARIABLE_HEADER *Variable
@@ -444,7 +390,7 @@ Returns:
//
// Be careful about pad size for alignment
//
- return (UINT8 *) ((UINTN) GET_VARIABLE_NAME_PTR (Variable) + NameSizeOfVariable (Variable) + GET_PAD_SIZE (NameSizeOfVariable (Variable)));
+ return (UINT8 *) ((UINTN) GET_VARIABLE_NAME_PTR (Variable) + NAMESIZE_OF_VARIABLE (Variable) + GET_PAD_SIZE (NAMESIZE_OF_VARIABLE (Variable)));
}
@@ -474,7 +420,7 @@ Returns:
//
// Be careful about pad size for alignment
//
- return (VARIABLE_HEADER *) HEADER_ALIGN (((UINTN) GetVariableDataPtr (Variable) + DataSizeOfVariable (Variable) + GET_PAD_SIZE (DataSizeOfVariable (Variable))));
+ return (VARIABLE_HEADER *) HEADER_ALIGN (((UINTN) GetVariableDataPtr (Variable) + DATASIZE_OF_VARIABLE (Variable) + GET_PAD_SIZE (DATASIZE_OF_VARIABLE (Variable))));
}
VARIABLE_HEADER *
@@ -836,8 +782,8 @@ Returns:
return EFI_SUCCESS;
} else {
if (CompareGuid (VendorGuid, &Variable[Index]->VendorGuid)) {
- ASSERT (NameSizeOfVariable (Variable[Index]) != 0);
- if (!CompareMem (VariableName, GET_VARIABLE_NAME_PTR (Variable[Index]), NameSizeOfVariable (Variable[Index]))) {
+ ASSERT (NAMESIZE_OF_VARIABLE (Variable[Index]) != 0);
+ if (!CompareMem (VariableName, GET_VARIABLE_NAME_PTR (Variable[Index]), NAMESIZE_OF_VARIABLE (Variable[Index]))) {
PtrTrack->CurrPtr = Variable[Index];
PtrTrack->Volatile = (BOOLEAN)(Index == 0);
return EFI_SUCCESS;
@@ -920,7 +866,7 @@ RuntimeServiceGetVariable (
//
// Get data size
//
- VarDataSize = DataSizeOfVariable (Variable.CurrPtr);
+ VarDataSize = DATASIZE_OF_VARIABLE (Variable.CurrPtr);
ASSERT (VarDataSize != 0);
if (*DataSize >= VarDataSize) {
@@ -1027,7 +973,7 @@ RuntimeServiceGetNextVariableName (
//
if (IsValidVariableHeader (Variable.CurrPtr) && Variable.CurrPtr->State == VAR_ADDED) {
if (!(EfiAtRuntime () && !(Variable.CurrPtr->Attributes & EFI_VARIABLE_RUNTIME_ACCESS))) {
- VarNameSize = NameSizeOfVariable (Variable.CurrPtr);
+ VarNameSize = NAMESIZE_OF_VARIABLE (Variable.CurrPtr);
ASSERT (VarNameSize != 0);
if (VarNameSize <= *VariableNameSize) {
@@ -1228,7 +1174,7 @@ RuntimeServiceSetVariable (
// If the variable is marked valid and the same data has been passed in
// then return to the caller immediately.
//
- if (DataSizeOfVariable (Variable.CurrPtr) == DataSize &&
+ if (DATASIZE_OF_VARIABLE (Variable.CurrPtr) == DataSize &&
(CompareMem (Data, GetVariableDataPtr (Variable.CurrPtr), DataSize) == 0)) {
UpdateVariableInfo (VariableName, VendorGuid, Volatile, FALSE, TRUE, FALSE, FALSE);