code scrub on VariableRuntime Dxe driver

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7017 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
eric_tian 2008-12-12 09:48:24 +00:00
parent 7c80e839f7
commit 45f6c85bb1
2 changed files with 11 additions and 25 deletions

View File

@ -36,8 +36,14 @@ VARIABLE_CACHE_ENTRY mVariableCache[] = {
} }
}; };
GLOBAL_REMOVE_IF_UNREFERENCED VARIABLE_INFO_ENTRY *gVariableInfo = NULL; VARIABLE_INFO_ENTRY *gVariableInfo = NULL;
EFI_STATUS
FtwVariableSpace (
IN EFI_PHYSICAL_ADDRESS VariableBaseAddress,
IN UINT8 *Buffer,
IN UINTN BufferSize
);
/** /**
@ -747,7 +753,7 @@ Reclaim (
@param[in] VariableName Name of variable @param[in] VariableName Name of variable
@param[in] VendorGuid Guid of variable @param[in] VendorGuid Guid of variable
@param[in] Attribute Attribue of the variable @param[in] Attributes Attribues of the variable
@param[in] DataSize Size of data. 0 means delete @param[in] DataSize Size of data. 0 means delete
@param[in] Data Variable data @param[in] Data Variable data
@ -1364,7 +1370,7 @@ RuntimeServiceSetVariable (
// Only variable have NV|RT attribute can be created in Runtime // Only variable have NV|RT attribute can be created in Runtime
// //
if (EfiAtRuntime () && if (EfiAtRuntime () &&
(!(Attributes & EFI_VARIABLE_RUNTIME_ACCESS) || !(Attributes & EFI_VARIABLE_NON_VOLATILE))) { (((Attributes & EFI_VARIABLE_RUNTIME_ACCESS) == 0) || ((Attributes & EFI_VARIABLE_NON_VOLATILE) == 0))) {
Status = EFI_INVALID_PARAMETER; Status = EFI_INVALID_PARAMETER;
goto Done; goto Done;
} }
@ -1420,7 +1426,7 @@ RuntimeServiceSetVariable (
// include pad size. // include pad size.
// //
VarSize = VarDataOffset + DataSize + GET_PAD_SIZE (DataSize); VarSize = VarDataOffset + DataSize + GET_PAD_SIZE (DataSize);
if (Attributes & EFI_VARIABLE_NON_VOLATILE) { if ((Attributes & EFI_VARIABLE_NON_VOLATILE) != 0) {
// //
// Create a nonvolatile variable // Create a nonvolatile variable
// //
@ -1655,7 +1661,7 @@ RuntimeServiceQueryVariableInfo (
// Make sure if runtime bit is set, boot service bit is set also. // Make sure if runtime bit is set, boot service bit is set also.
// //
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} else if (EfiAtRuntime () && !(Attributes & EFI_VARIABLE_RUNTIME_ACCESS)) { } else if (EfiAtRuntime () && ((Attributes & EFI_VARIABLE_RUNTIME_ACCESS) == 0)) {
// //
// Make sure RT Attribute is set if we are in Runtime phase. // Make sure RT Attribute is set if we are in Runtime phase.
// //

View File

@ -85,24 +85,4 @@ typedef struct {
VOID *Data; VOID *Data;
} VARIABLE_CACHE_ENTRY; } VARIABLE_CACHE_ENTRY;
//
// Functions
//
EFI_STATUS
EFIAPI
VariableServiceInitialize (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
);
EFI_STATUS
FtwVariableSpace (
IN EFI_PHYSICAL_ADDRESS VariableBaseAddress,
IN UINT8 *Buffer,
IN UINTN BufferSize
);
#endif #endif