]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ppi/ReadOnlyVariable2.h
Formalize comments for Protocols and PPIs.
[mirror_edk2.git] / MdePkg / Include / Ppi / ReadOnlyVariable2.h
1 /** @file
2 This file declares Read-only Variable Service2 PPI.
3 This ppi permits read-only access to the UEFI variable store during the PEI phase.
4
5 Copyright (c) 2006 - 2008, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 @par Revision Reference:
15 This PPI is defined in PI
16 Version 1.00.
17
18 **/
19
20 #ifndef __PEI_READ_ONLY_VARIABLE2_PPI_H__
21 #define __PEI_READ_ONLY_VARIABLE2_PPI_H__
22
23 #define EFI_PEI_READ_ONLY_VARIABLE2_PPI_GUID \
24 { 0x2ab86ef5, 0xecb5, 0x4134, { 0xb5, 0x56, 0x38, 0x54, 0xca, 0x1f, 0xe1, 0xb4 } }
25
26
27 typedef struct _EFI_PEI_READ_ONLY_VARIABLE2_PPI EFI_PEI_READ_ONLY_VARIABLE2_PPI;
28
29 /**
30 This service retrieves a variable's value using its name and GUID.
31
32 Read the specified variable from the UEFI variable store. If the Data
33 buffer is too small to hold the contents of the variable,
34 the error EFI_BUFFER_TOO_SMALL is returned and DataSize is set to the
35 required buffer size to obtain the data.
36
37 @param This A pointer to this instance of the EFI_PEI_READ_ONLY_VARIABLE2_PPI.
38 @param VariableName A pointer to a null-terminated string that is the variable's name.
39 @param VendorGuid A pointer to an EFI_GUID that is the variable's GUID. The combination of
40 VariableGuid and VariableName must be unique.
41 @param Attributes If non-NULL, on return, points to the variable's attributes.
42 @param DataSize On entry, points to the size in bytes of the Data buffer.
43 On return, points to the size of the data returned in Data.
44 @param Data Points to the buffer which will hold the returned variable value.
45
46 @retval EFI_SUCCESS The variable was read successfully.
47 @retval EFI_NOT_FOUND The variable could not be found.
48 @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the resulting data.
49 DataSize is updated with the size required for
50 the specified variable.
51 @retval EFI_INVALID_PARAMETER VariableName, VariableGuid, DataSize or Data is NULL.
52 @retval EFI_DEVICE_ERROR The variable could not be retrieved because of a device error.
53
54 **/
55 typedef
56 EFI_STATUS
57 (EFIAPI *EFI_PEI_GET_VARIABLE2)(
58 IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This,
59 IN CONST CHAR16 *VariableName,
60 IN CONST EFI_GUID *VariableGuid,
61 OUT UINT32 *Attributes,
62 IN OUT UINTN *DataSize,
63 OUT VOID *Data
64 );
65
66
67 /**
68 Return the next variable name and GUID.
69
70 This function is called multiple times to retrieve the VariableName
71 and VariableGuid of all variables currently available in the system.
72 On each call, the previous results are passed into the interface,
73 and, on return, the interface returns the data for the next
74 interface. When the entire variable list has been returned,
75 EFI_NOT_FOUND is returned.
76
77 @param This A pointer to this instance of the EFI_PEI_READ_ONLY_VARIABLE2_PPI.
78
79 @param VariableNameSize On entry, points to the size of the buffer pointed to by VariableName.
80 @param VariableName On entry, a pointer to a null-terminated string that is the variable's name.
81 On return, points to the next variable's null-terminated name string.
82
83 @param VendorGuid On entry, a pointer to an UEFI _GUID that is the variable's GUID.
84 On return, a pointer to the next variable's GUID.
85
86 @retval EFI_SUCCESS The variable was read successfully.
87 @retval EFI_NOT_FOUND The variable could not be found.
88 @retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the resulting
89 data. VariableNameSize is updated with the size
90 required for the specified variable.
91 @retval EFI_INVALID_PARAMETER VariableName, VariableGuid or
92 VariableNameSize is NULL.
93 @retval EFI_DEVICE_ERROR The variable could not be retrieved because of a device error.
94
95 **/
96 typedef
97 EFI_STATUS
98 (EFIAPI *EFI_PEI_NEXT_VARIABLE_NAME2)(
99 IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This,
100 IN OUT UINTN *VariableNameSize,
101 IN OUT CHAR16 *VariableName,
102 IN OUT EFI_GUID *VariableGuid
103 );
104
105 ///
106 /// This PPI provides a lightweight, read-only variant of the full EFI
107 /// variable services.
108 ///
109 struct _EFI_PEI_READ_ONLY_VARIABLE2_PPI {
110 EFI_PEI_GET_VARIABLE2 GetVariable;
111 EFI_PEI_NEXT_VARIABLE_NAME2 NextVariableName;
112 };
113
114 extern EFI_GUID gEfiPeiReadOnlyVariable2PpiGuid;
115
116 #endif