Variable = NextVariable;\r
}\r
\r
- Status = gBS->AllocatePool (\r
- EfiBootServicesData,\r
- ValidBufferSize,\r
- (VOID **) &ValidBuffer\r
- );\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
+ ValidBuffer = AllocatePool (ValidBufferSize);\r
+ if (ValidBuffer == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
}\r
\r
SetMem (ValidBuffer, ValidBufferSize, 0xff);\r
}\r
}\r
\r
- gBS->FreePool (ValidBuffer);\r
+ FreePool (ValidBuffer);\r
\r
if (EFI_ERROR (Status)) {\r
*LastVariableOffset = 0;\r
*RemainingVariableStorageSize -= VariableSize;\r
}\r
}\r
- \r
+\r
//\r
// Go to the next one\r
//\r
Variable = NextVariable;\r
}\r
- \r
+\r
ReleaseLockOnlyAtBootTime (&Global->VariableServicesLock);\r
return EFI_SUCCESS;\r
}\r
UINTN Index;\r
UINT8 Data;\r
\r
- Status = gBS->AllocatePool (\r
- EfiRuntimeServicesData,\r
- sizeof (ESAL_VARIABLE_GLOBAL),\r
- (VOID **) &mVariableModuleGlobal\r
- );\r
-\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
+ mVariableModuleGlobal = AllocateRuntimePool (sizeof (ESAL_VARIABLE_GLOBAL));\r
+ if (mVariableModuleGlobal == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
}\r
\r
EfiInitializeLock(&mVariableModuleGlobal->VariableGlobal[Physical].VariableServicesLock, EFI_TPL_NOTIFY);\r
//\r
// Allocate memory for volatile variable store\r
//\r
- Status = gBS->AllocatePool (\r
- EfiRuntimeServicesData,\r
- VARIABLE_STORE_SIZE + SCRATCH_SIZE,\r
- (VOID **) &VolatileVariableStore\r
- );\r
-\r
- if (EFI_ERROR (Status)) {\r
- gBS->FreePool (mVariableModuleGlobal);\r
- return Status;\r
+ VolatileVariableStore = AllocateRuntimePool (VARIABLE_STORE_SIZE + SCRATCH_SIZE);\r
+ if (VolatileVariableStore == NULL) {\r
+ FreePool (mVariableModuleGlobal);\r
+ return EFI_OUT_OF_RESOURCES;\r
}\r
\r
SetMem (VolatileVariableStore, VARIABLE_STORE_SIZE + SCRATCH_SIZE, 0xff);\r
\r
Status = gDS->GetMemorySpaceDescriptor (BaseAddress, &GcdDescriptor);\r
if (EFI_ERROR (Status)) {\r
- gBS->FreePool (mVariableModuleGlobal);\r
- gBS->FreePool (VolatileVariableStore);\r
+ FreePool (mVariableModuleGlobal);\r
+ FreePool (VolatileVariableStore);\r
return EFI_UNSUPPORTED;\r
}\r
\r
GcdDescriptor.Attributes | EFI_MEMORY_RUNTIME\r
);\r
if (EFI_ERROR (Status)) {\r
- gBS->FreePool (mVariableModuleGlobal);\r
- gBS->FreePool (VolatileVariableStore);\r
+ FreePool (mVariableModuleGlobal);\r
+ FreePool (VolatileVariableStore);\r
return EFI_UNSUPPORTED;\r
}\r
//\r
}\r
\r
if (EFI_ERROR (Status)) {\r
- gBS->FreePool (mVariableModuleGlobal);\r
- gBS->FreePool (VolatileVariableStore);\r
+ FreePool (mVariableModuleGlobal);\r
+ FreePool (VolatileVariableStore);\r
return Status;\r
}\r
\r
}\r
\r
if (EFI_ERROR (Status)) {\r
- gBS->FreePool (mVariableModuleGlobal);\r
- gBS->FreePool (VolatileVariableStore);\r
+ FreePool (mVariableModuleGlobal);\r
+ FreePool (VolatileVariableStore);\r
}\r
\r
return Status;\r