X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FInclude%2FPpi%2FReadOnlyVariable2.h;h=6d8ea603811fbdf810915f0505ee7eff0e8991ee;hp=f4f85086ca480211e592ca2bba14da1bfcbc5b60;hb=bca08c489cc458f551ba27c3530353e77c07ba40;hpb=ba2377328775b10caa4c2091a8997eb8685c39b8 diff --git a/MdePkg/Include/Ppi/ReadOnlyVariable2.h b/MdePkg/Include/Ppi/ReadOnlyVariable2.h index f4f85086ca..6d8ea60381 100644 --- a/MdePkg/Include/Ppi/ReadOnlyVariable2.h +++ b/MdePkg/Include/Ppi/ReadOnlyVariable2.h @@ -1,18 +1,18 @@ /** @file - This file declares Read-only Variable Service PPI + This file declares Read-only Variable Service2 PPI. + This ppi permits read-only access to the UEFI variable store during the PEI phase. - Copyright (c) 2006 - 2007, 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 +Copyright (c) 2006 - 2017, 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 that accompanies this distribution. +The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php. - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. @par Revision Reference: - This PPI is defined in PI - Version 1.00. + This PPI is introduced in PI Version 1.0. **/ @@ -26,37 +26,29 @@ typedef struct _EFI_PEI_READ_ONLY_VARIABLE2_PPI EFI_PEI_READ_ONLY_VARIABLE2_PPI; /** + 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 VendorGuid 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. See ¡°Related Definitons¡± - below for possible attribute values. - - @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 function completed successfully. + @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. + May be NULL with a zero DataSize in order to determine the size of the buffer needed. + @retval EFI_SUCCESS The variable was read successfully. @retval EFI_NOT_FOUND The variable was not 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. **/ @@ -68,11 +60,13 @@ EFI_STATUS IN CONST EFI_GUID *VariableGuid, OUT UINT32 *Attributes, IN OUT UINTN *DataSize, - OUT VOID *Data + OUT VOID *Data OPTIONAL ); /** + 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, @@ -83,51 +77,39 @@ EFI_STATUS @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 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 VendorGuid On entry, a pointer to an UEFI _GUID that is the variable¡¯s GUID. - On return, a pointer to the next variable¡¯s GUID. - + @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. **/ typedef EFI_STATUS -(EFIAPI *EFI_PEI_NEXT_VARIABLE_NAME2) ( +(EFIAPI *EFI_PEI_GET_NEXT_VARIABLE_NAME2)( IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This, IN OUT UINTN *VariableNameSize, IN OUT CHAR16 *VariableName, IN OUT EFI_GUID *VariableGuid ); -/** - This PPI provides a lightweight, read-only variant of the full EFI - variable services. - - @param GetVariable - A service to ascertain a given variable name. - - @param GetNextVariableName - A service to ascertain a variable based upon a given, known variable - -**/ +/// +/// This PPI provides a lightweight, read-only variant of the full EFI +/// variable services. +/// struct _EFI_PEI_READ_ONLY_VARIABLE2_PPI { - EFI_PEI_GET_VARIABLE2 GetVariable; - EFI_PEI_NEXT_VARIABLE_NAME2 NextVariableName; + EFI_PEI_GET_VARIABLE2 GetVariable; + EFI_PEI_GET_NEXT_VARIABLE_NAME2 NextVariableName; }; extern EFI_GUID gEfiPeiReadOnlyVariable2PpiGuid;