X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FVariable%2FPei%2FVariable.c;h=5424aa501ff3e709065f3642ea4df585f7eaffa3;hb=e5eed7d3641d71d7ea539e5379ea9c6a5cd97004;hp=517d38130bd72b4d5538785d4b1a316a19e15247;hpb=504214c4870e9183418014634268ce630eb5332a;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/Variable/Pei/Variable.c b/MdeModulePkg/Universal/Variable/Pei/Variable.c index 517d38130b..5424aa501f 100644 --- a/MdeModulePkg/Universal/Variable/Pei/Variable.c +++ b/MdeModulePkg/Universal/Variable/Pei/Variable.c @@ -1,10 +1,10 @@ /** @file Implement ReadOnly Variable Services required by PEIM and install - PI ReadOnly Varaiable2 PPI. These services operates the non volatile storage space. + PEI ReadOnly Varaiable2 PPI. These services operates the non volatile storage space. -Copyright (c) 2006 - 2008 Intel Corporation.
-All rights reserved. This program and the accompanying materials +Copyright (c) 2006 - 2010, 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 @@ -21,12 +21,12 @@ Module Name: // // Module globals // -static EFI_PEI_READ_ONLY_VARIABLE2_PPI mVariablePpi = { +EFI_PEI_READ_ONLY_VARIABLE2_PPI mVariablePpi = { PeiGetVariable, PeiGetNextVariableName }; -static EFI_PEI_PPI_DESCRIPTOR mPpiListVariable = { +EFI_PEI_PPI_DESCRIPTOR mPpiListVariable = { (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), &gEfiPeiReadOnlyVariable2PpiGuid, &mVariablePpi @@ -34,56 +34,57 @@ static EFI_PEI_PPI_DESCRIPTOR mPpiListVariable = { EFI_GUID mEfiVariableIndexTableGuid = EFI_VARIABLE_INDEX_TABLE_GUID; + +/** + Provide the functionality of the variable services. + + @param FileHandle Handle of the file being invoked. + Type EFI_PEI_FILE_HANDLE is defined in FfsFindNextFile(). + @param PeiServices General purpose services available to every PEIM. + + @retval EFI_SUCCESS If the interface could be successfully installed + @retval Others Returned from PeiServicesInstallPpi() + +**/ EFI_STATUS EFIAPI PeimInitializeVariableServices ( - IN EFI_FFS_FILE_HEADER *FfsHeader, - IN EFI_PEI_SERVICES **PeiServices + IN EFI_PEI_FILE_HANDLE FileHandle, + IN CONST EFI_PEI_SERVICES **PeiServices ) -/*++ - -Routine Description: +{ + EFI_BOOT_MODE BootMode; + EFI_STATUS Status; - Provide the functionality of the variable services. + // + // Check if this is recovery boot path. If no, publish the variable access capability + // to other modules. If yes, the content of variable area is not reliable. Therefore, + // in this case we should not provide variable service to other pei modules. + // + Status = (*PeiServices)->GetBootMode (PeiServices, &BootMode); + ASSERT_EFI_ERROR (Status); + + if (BootMode == BOOT_IN_RECOVERY_MODE) { + return EFI_UNSUPPORTED; + } -Arguments: + return PeiServicesInstallPpi (&mPpiListVariable); - FfsHeadher - The FFS file header - PeiServices - General purpose services available to every PEIM. +} -Returns: +/** - Status - EFI_SUCCESS if the interface could be successfully - installed + Gets the pointer to the first variable header in given variable store area. ---*/ -{ - // - // Publish the variable capability to other modules - // - return (**PeiServices).InstallPpi ((CONST EFI_PEI_SERVICES **)PeiServices, &mPpiListVariable); + @param VarStoreHeader Pointer to the Variable Store Header. -} + @return Pointer to the first variable header +**/ VARIABLE_HEADER * GetStartPointer ( IN VARIABLE_STORE_HEADER *VarStoreHeader ) -/*++ - -Routine Description: - - This code gets the pointer to the first variable memory pointer byte - -Arguments: - - VarStoreHeader Pointer to the Variable Store Header. - -Returns: - - VARIABLE_HEADER* Pointer to last unavailable Variable Header - ---*/ { // // The end of variable store @@ -91,25 +92,19 @@ Returns: return (VARIABLE_HEADER *) HEADER_ALIGN (VarStoreHeader + 1); } -VARIABLE_HEADER * -GetEndPointer ( - IN VARIABLE_STORE_HEADER *VarStoreHeader - ) -/*++ - -Routine Description: - This code gets the pointer to the last variable memory pointer byte +/** + This code gets the pointer to the last variable memory pointer byte. -Arguments: + @param VarStoreHeader Pointer to the Variable Store Header. - VarStoreHeader Pointer to the Variable Store Header. + @return VARIABLE_HEADER* pointer to last unavailable Variable Header. -Returns: - - VARIABLE_HEADER* Pointer to last unavailable Variable Header - ---*/ +**/ +VARIABLE_HEADER * +GetEndPointer ( + IN VARIABLE_STORE_HEADER *VarStoreHeader + ) { // // The end of variable store @@ -117,26 +112,20 @@ Returns: return (VARIABLE_HEADER *) HEADER_ALIGN ((UINTN) VarStoreHeader + VarStoreHeader->Size); } -STATIC -BOOLEAN -EFIAPI -IsValidVariableHeader ( - IN VARIABLE_HEADER *Variable - ) -/*++ - -Routine Description: +/** This code checks if variable header is valid or not. -Arguments: - Variable Pointer to the Variable Header. + @param Variable Pointer to the Variable Header. -Returns: - TRUE Variable header is valid. - FALSE Variable header is not valid. + @retval TRUE Variable header is valid. + @retval FALSE Variable header is not valid. ---*/ +**/ +BOOLEAN +IsValidVariableHeader ( + IN VARIABLE_HEADER *Variable + ) { if (Variable == NULL || Variable->StartId != VARIABLE_DATA ) { return FALSE; @@ -146,108 +135,81 @@ Returns: } -UINTN -NameSizeOfVariable ( - IN VARIABLE_HEADER *Variable - ) -/*++ - -Routine Description: - +/** This code gets the size of name of variable. -Arguments: + @param Variable Pointer to the Variable Header. - Variable Pointer to the Variable Header. + @return Size of variable in bytes in type UINTN. -Returns: - - UINTN Size of variable in bytes - ---*/ +**/ +UINTN +NameSizeOfVariable ( + IN VARIABLE_HEADER *Variable + ) { if (Variable->State == (UINT8) (-1) || - Variable->DataSize == (UINT32) -1 || - Variable->NameSize == (UINT32) -1 || - Variable->Attributes == (UINT32) -1) { + Variable->DataSize == (UINT32) (-1) || + Variable->NameSize == (UINT32) (-1) || + Variable->Attributes == (UINT32) (-1)) { return 0; } return (UINTN) Variable->NameSize; } -UINTN -DataSizeOfVariable ( - IN VARIABLE_HEADER *Variable - ) -/*++ - -Routine Description: - This code gets the size of name of variable. - -Arguments: - - Variable Pointer to the Variable Header. +/** + This code gets the size of data of variable. -Returns: + @param Variable Pointer to the Variable Header. - UINTN Size of variable in bytes + @return Size of variable in bytes in type UINTN. ---*/ +**/ +UINTN +DataSizeOfVariable ( + IN VARIABLE_HEADER *Variable + ) { - if (Variable->State == (UINT8) -1 || - Variable->DataSize == (UINT32) -1 || - Variable->NameSize == (UINT32) -1 || - Variable->Attributes == (UINT32) -1) { + if (Variable->State == (UINT8) (-1) || + Variable->DataSize == (UINT32) (-1) || + Variable->NameSize == (UINT32) (-1) || + Variable->Attributes == (UINT32) (-1)) { return 0; } return (UINTN) Variable->DataSize; } -CHAR16 * -GetVariableNamePtr ( - IN VARIABLE_HEADER *Variable - ) -/*++ - -Routine Description: - +/** This code gets the pointer to the variable name. -Arguments: - - Variable Pointer to the Variable Header. + @param Variable Pointer to the Variable Header. -Returns: + @return A CHAR16* pointer to Variable Name. - CHAR16* Pointer to Variable Name - ---*/ +**/ +CHAR16 * +GetVariableNamePtr ( + IN VARIABLE_HEADER *Variable + ) { return (CHAR16 *) (Variable + 1); } -UINT8 * -GetVariableDataPtr ( - IN VARIABLE_HEADER *Variable - ) -/*++ - -Routine Description: - +/** This code gets the pointer to the variable data. -Arguments: + @param Variable Pointer to the Variable Header. - Variable Pointer to the Variable Header. + @return A UINT8* pointer to Variable Data. -Returns: - - UINT8* Pointer to Variable Data - ---*/ +**/ +UINT8 * +GetVariableDataPtr ( + IN VARIABLE_HEADER *Variable + ) { UINTN Value; @@ -261,25 +223,19 @@ Returns: return (UINT8 *) Value; } -VARIABLE_HEADER * -GetNextVariablePtr ( - IN VARIABLE_HEADER *Variable - ) -/*++ - -Routine Description: +/** This code gets the pointer to the next variable header. -Arguments: + @param Variable Pointer to the Variable Header. - Variable Pointer to the Variable Header. + @return A VARIABLE_HEADER* pointer to next variable header. -Returns: - - VARIABLE_HEADER* Pointer to next variable header. - ---*/ +**/ +VARIABLE_HEADER * +GetNextVariablePtr ( + IN VARIABLE_HEADER *Variable + ) { UINTN Value; @@ -297,32 +253,23 @@ Returns: return (VARIABLE_HEADER *) HEADER_ALIGN (Value); } +/** + This code gets the pointer to the variable name. + + @param VarStoreHeader Pointer to the Variable Store Header. -STATIC + @retval EfiRaw Variable store is raw + @retval EfiValid Variable store is valid + @retval EfiInvalid Variable store is invalid + +**/ VARIABLE_STORE_STATUS -EFIAPI GetVariableStoreStatus ( IN VARIABLE_STORE_HEADER *VarStoreHeader ) -/*++ - -Routine Description: - - This code gets the pointer to the variable name. - -Arguments: - - VarStoreHeader Pointer to the Variable Store Header. - -Returns: - - EfiRaw Variable store is raw - EfiValid Variable store is valid - EfiInvalid Variable store is invalid - ---*/ { - if (VarStoreHeader->Signature == VARIABLE_STORE_SIGNATURE && + + if (CompareGuid (&VarStoreHeader->Signature, &gEfiVariableGuid) && VarStoreHeader->Format == VARIABLE_STORE_FORMATTED && VarStoreHeader->State == VARIABLE_STORE_HEALTHY ) { @@ -330,7 +277,10 @@ Returns: return EfiValid; } - if (VarStoreHeader->Signature == 0xffffffff && + if (((UINT32 *)(&VarStoreHeader->Signature))[0] == 0xffffffff && + ((UINT32 *)(&VarStoreHeader->Signature))[1] == 0xffffffff && + ((UINT32 *)(&VarStoreHeader->Signature))[2] == 0xffffffff && + ((UINT32 *)(&VarStoreHeader->Signature))[3] == 0xffffffff && VarStoreHeader->Size == 0xffffffff && VarStoreHeader->Format == 0xff && VarStoreHeader->State == 0xff @@ -342,7 +292,19 @@ Returns: } } -STATIC + +/** + This function compares a variable with variable entries in database. + + @param Variable Pointer to the variable in our database + @param VariableName Name of the variable to compare to 'Variable' + @param VendorGuid GUID of the variable to compare to 'Variable' + @param PtrTrack Variable Track Pointer structure that contains Variable Information. + + @retval EFI_SUCCESS Found match variable + @retval EFI_NOT_FOUND Variable not found + +**/ EFI_STATUS CompareWithValidVariable ( IN VARIABLE_HEADER *Variable, @@ -350,26 +312,6 @@ CompareWithValidVariable ( IN CONST EFI_GUID *VendorGuid, OUT VARIABLE_POINTER_TRACK *PtrTrack ) -/*++ - -Routine Description: - - This function compares a variable with variable entries in database - -Arguments: - - Variable - Pointer to the variable in our database - VariableName - Name of the variable to compare to 'Variable' - VendorGuid - GUID of the variable to compare to 'Variable' - PtrTrack - Variable Track Pointer structure that contains - Variable Information. - -Returns: - - EFI_SUCCESS - Found match variable - EFI_NOT_FOUND - Variable not found - ---*/ { VOID *Point; @@ -389,7 +331,7 @@ Returns: ) { ASSERT (NameSizeOfVariable (Variable) != 0); Point = (VOID *) GetVariableNamePtr (Variable); - if (!CompareMem (VariableName, Point, NameSizeOfVariable (Variable))) { + if (CompareMem (VariableName, Point, NameSizeOfVariable (Variable)) == 0) { PtrTrack->CurrPtr = Variable; return EFI_SUCCESS; } @@ -399,55 +341,56 @@ Returns: return EFI_NOT_FOUND; } -STATIC + +/** + This code finds variable in storage blocks (Non-Volatile). + + @param PeiServices General purpose services available to every PEIM. + @param VariableName Name of the variable to be found + @param VendorGuid Vendor GUID to be found. + @param PtrTrack Variable Track Pointer structure that contains Variable Information. + + @retval EFI_SUCCESS Variable found successfully + @retval EFI_NOT_FOUND Variable not found + @retval EFI_INVALID_PARAMETER Invalid variable name + +**/ EFI_STATUS -EFIAPI FindVariable ( - IN EFI_PEI_SERVICES **PeiServices, + IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST CHAR16 *VariableName, IN CONST EFI_GUID *VendorGuid, OUT VARIABLE_POINTER_TRACK *PtrTrack ) -/*++ - -Routine Description: - - This code finds variable in storage blocks (Non-Volatile) - -Arguments: - - PeiServices - General purpose services available to every PEIM. - VariableName - Name of the variable to be found - VendorGuid - Vendor GUID to be found. - PtrTrack - Variable Track Pointer structure that contains - Variable Information. - -Returns: - - EFI_SUCCESS - Variable found successfully - EFI_NOT_FOUND - Variable not found - EFI_INVALID_PARAMETER - Invalid variable name - ---*/ { EFI_HOB_GUID_TYPE *GuidHob; VARIABLE_STORE_HEADER *VariableStoreHeader; VARIABLE_HEADER *Variable; + VARIABLE_HEADER *LastVariable; VARIABLE_HEADER *MaxIndex; VARIABLE_INDEX_TABLE *IndexTable; UINT32 Count; + UINT32 Offset; UINT8 *VariableBase; + BOOLEAN StopRecord; - if (VariableName != 0 && VendorGuid == NULL) { + if (VariableName[0] != 0 && VendorGuid == NULL) { return EFI_INVALID_PARAMETER; } // // No Variable Address equals zero, so 0 as initial value is safe. // MaxIndex = 0; + StopRecord = FALSE; GuidHob = GetFirstGuidHob (&mEfiVariableIndexTableGuid); if (GuidHob == NULL) { + // + // If it's the first time to access variable region in flash, create a guid hob to record + // VAR_ADDED type variable info. + // Note that as the resource of PEI phase is limited, only store the number of + // VARIABLE_INDEX_TABLE_VOLUME of VAR_ADDED type variables to reduce access time. + // IndexTable = BuildGuidHob (&mEfiVariableIndexTableGuid, sizeof (VARIABLE_INDEX_TABLE)); IndexTable->Length = 0; IndexTable->StartPtr = NULL; @@ -455,10 +398,14 @@ Returns: IndexTable->GoneThrough = 0; } else { IndexTable = GET_GUID_HOB_DATA (GuidHob); - for (Count = 0; Count < IndexTable->Length; Count++) - { - MaxIndex = GetVariableByIndex (IndexTable, Count); - + for (Offset = 0, Count = 0; Count < IndexTable->Length; Count++) { + // + // traverse the variable info list to look for varible. + // The IndexTable->Index[Count] records the distance of two neighbouring VAR_ADDED type variables. + // + ASSERT (Count < VARIABLE_INDEX_TABLE_VOLUME); + Offset += IndexTable->Index[Count]; + MaxIndex = (VARIABLE_HEADER *)((CHAR8 *)(IndexTable->StartPtr) + Offset); if (CompareWithValidVariable (MaxIndex, VariableName, VendorGuid, PtrTrack) == EFI_SUCCESS) { PtrTrack->StartPtr = IndexTable->StartPtr; PtrTrack->EndPtr = IndexTable->EndPtr; @@ -467,7 +414,7 @@ Returns: } } - if (IndexTable->GoneThrough) { + if (IndexTable->GoneThrough != 0) { return EFI_NOT_FOUND; } } @@ -475,9 +422,10 @@ Returns: // If not found in HOB, then let's start from the MaxIndex we've found. // if (MaxIndex != NULL) { - Variable = GetNextVariablePtr (MaxIndex); + Variable = GetNextVariablePtr (MaxIndex); + LastVariable = MaxIndex; } else { - if (IndexTable->StartPtr || IndexTable->EndPtr) { + if ((IndexTable->StartPtr != NULL) || (IndexTable->EndPtr != NULL)) { Variable = IndexTable->StartPtr; } else { VariableBase = (UINT8 *) (UINTN) PcdGet32 (PcdFlashNvStorageVariableBase); @@ -503,6 +451,8 @@ Returns: // Variable = IndexTable->StartPtr; } + + LastVariable = IndexTable->StartPtr; } // // Find the variable by walk through non-volatile variable store @@ -510,14 +460,26 @@ Returns: PtrTrack->StartPtr = IndexTable->StartPtr; PtrTrack->EndPtr = IndexTable->EndPtr; - while (IsValidVariableHeader (Variable) && (Variable <= IndexTable->EndPtr)) { + while ((Variable < IndexTable->EndPtr) && IsValidVariableHeader (Variable)) { if (Variable->State == VAR_ADDED) { // // Record Variable in VariableIndex HOB // - if (IndexTable->Length < VARIABLE_INDEX_TABLE_VOLUME) - { - VariableIndexTableUpdate (IndexTable, Variable); + if (IndexTable->Length < VARIABLE_INDEX_TABLE_VOLUME && !StopRecord) { + Offset = (UINT32)((UINTN)Variable - (UINTN)LastVariable); + // + // The distance of two neighbouring VAR_ADDED variable is larger than 2^16, + // which is beyond the allowable scope(UINT16) of record. In such case, need not to + // record the subsequent VAR_ADDED type variables again. + // + if ((Offset & 0xFFFF0000UL) != 0) { + StopRecord = TRUE; + } + + if (!StopRecord) { + IndexTable->Index[IndexTable->Length++] = (UINT16) Offset; + } + LastVariable = Variable; } if (CompareWithValidVariable (Variable, VariableName, VendorGuid, PtrTrack) == EFI_SUCCESS) { @@ -539,6 +501,32 @@ Returns: return EFI_NOT_FOUND; } +/** + This service retrieves a variable's value using its name and GUID. + + Read the specified variable from the UEFI variable store. If the Data + buffer is too small to hold the contents of the variable, the error + EFI_BUFFER_TOO_SMALL is returned and DataSize is set to the required buffer + size to obtain the data. + + @param This A pointer to this instance of the EFI_PEI_READ_ONLY_VARIABLE2_PPI. + @param VariableName A pointer to a null-terminated string that is the variable's name. + @param VariableGuid A pointer to an EFI_GUID that is the variable's GUID. The combination of + VariableGuid and VariableName must be unique. + @param Attributes If non-NULL, on return, points to the variable's attributes. + @param DataSize On entry, points to the size in bytes of the Data buffer. + On return, points to the size of the data returned in Data. + @param Data Points to the buffer which will hold the returned variable value. + + @retval EFI_SUCCESS The variable was read successfully. + @retval EFI_NOT_FOUND The variable could not be found. + @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the resulting data. + DataSize is updated with the size required for + the specified variable. + @retval EFI_INVALID_PARAMETER VariableName, VariableGuid, DataSize or Data is NULL. + @retval EFI_DEVICE_ERROR The variable could not be retrieved because of a device error. + +**/ EFI_STATUS EFIAPI PeiGetVariable ( @@ -549,40 +537,11 @@ PeiGetVariable ( IN OUT UINTN *DataSize, OUT VOID *Data ) -/*++ - -Routine Description: - - Provide the read variable functionality of the variable services. - -Arguments: - - PeiServices - General purpose services available to every PEIM. - - VariableName - The variable name - - VendorGuid - The vendor's GUID - - Attributes - Pointer to the attribute - - DataSize - Size of data - - Data - Pointer to data - -Returns: - - EFI_SUCCESS - The interface could be successfully installed - - EFI_NOT_FOUND - The variable could not be discovered - - EFI_BUFFER_TOO_SMALL - The caller buffer is not large enough - ---*/ { VARIABLE_POINTER_TRACK Variable; UINTN VarDataSize; EFI_STATUS Status; - EFI_PEI_SERVICES **PeiServices; + CONST EFI_PEI_SERVICES **PeiServices; PeiServices = GetPeiServicesTablePointer (); if (VariableName == NULL || VariableGuid == NULL || DataSize == NULL) { @@ -600,14 +559,11 @@ Returns: // VarDataSize = DataSizeOfVariable (Variable.CurrPtr); if (*DataSize >= VarDataSize) { - // - // PO-TKW: Address one checking in this place - // if (Data == NULL) { return EFI_INVALID_PARAMETER; } - (*PeiServices)->CopyMem (Data, GetVariableDataPtr (Variable.CurrPtr), VarDataSize); + CopyMem (Data, GetVariableDataPtr (Variable.CurrPtr), VarDataSize); if (Attributes != NULL) { *Attributes = Variable.CurrPtr->Attributes; @@ -621,6 +577,35 @@ Returns: } } +/** + Return the next variable name and GUID. + + This function is called multiple times to retrieve the VariableName + and VariableGuid of all variables currently available in the system. + On each call, the previous results are passed into the interface, + and, on return, the interface returns the data for the next + interface. When the entire variable list has been returned, + EFI_NOT_FOUND is returned. + + @param This A pointer to this instance of the EFI_PEI_READ_ONLY_VARIABLE2_PPI. + + @param VariableNameSize On entry, points to the size of the buffer pointed to by VariableName. + On return, the size of the variable name buffer. + @param VariableName On entry, a pointer to a null-terminated string that is the variable's name. + On return, points to the next variable's null-terminated name string. + @param VariableGuid On entry, a pointer to an EFI_GUID that is the variable's GUID. + On return, a pointer to the next variable's GUID. + + @retval EFI_SUCCESS The variable was read successfully. + @retval EFI_NOT_FOUND The variable could not be found. + @retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the resulting + data. VariableNameSize is updated with the size + required for the specified variable. + @retval EFI_INVALID_PARAMETER VariableName, VariableGuid or + VariableNameSize is NULL. + @retval EFI_DEVICE_ERROR The variable could not be retrieved because of a device error. + +**/ EFI_STATUS EFIAPI PeiGetNextVariableName ( @@ -629,37 +614,11 @@ PeiGetNextVariableName ( IN OUT CHAR16 *VariableName, IN OUT EFI_GUID *VariableGuid ) -/*++ - -Routine Description: - - Provide the get next variable functionality of the variable services. - -Arguments: - - PeiServices - General purpose services available to every PEIM. - VariabvleNameSize - The variable name's size. - VariableName - A pointer to the variable's name. - VariableGuid - A pointer to the EFI_GUID structure. - - VariableNameSize - Size of the variable name - - VariableName - The variable name - - VendorGuid - The vendor's GUID - -Returns: - - EFI_SUCCESS - The interface could be successfully installed - - EFI_NOT_FOUND - The variable could not be discovered - ---*/ { VARIABLE_POINTER_TRACK Variable; UINTN VarNameSize; EFI_STATUS Status; - EFI_PEI_SERVICES **PeiServices; + CONST EFI_PEI_SERVICES **PeiServices; PeiServices = GetPeiServicesTablePointer (); if (VariableName == NULL || VariableGuid == NULL || VariableNameSize == NULL) { @@ -685,9 +644,9 @@ Returns: VarNameSize = (UINTN) NameSizeOfVariable (Variable.CurrPtr); if (VarNameSize <= *VariableNameSize) { - (*PeiServices)->CopyMem (VariableName, GetVariableNamePtr (Variable.CurrPtr), VarNameSize); + CopyMem (VariableName, GetVariableNamePtr (Variable.CurrPtr), VarNameSize); - (*PeiServices)->CopyMem (VariableGuid, &Variable.CurrPtr->VendorGuid, sizeof (EFI_GUID)); + CopyMem (VariableGuid, &Variable.CurrPtr->VendorGuid, sizeof (EFI_GUID)); Status = EFI_SUCCESS; } else {