]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ppi/ReadOnlyVariable2.h
Code Scrub for header files in MdePkg/Include/Ppi and Uefi directory.
[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
39 @param VariableName A pointer to a null-terminated string that is the variable's name.
40
41 @param VendorGuid A pointer to an EFI_GUID that is the variable's GUID. The combination of
42 VariableGuid and VariableName must be unique.
43
44 @param Attributes If non-NULL, on return, points to the variable's attributes. See "Related Definitons"
45 below for possible attribute values.
46
47 @param DataSize On entry, points to the size in bytes of the Data buffer. On return, points to the size of
48 the data returned in Data.
49
50 @param Data Points to the buffer which will hold the returned variable value.
51
52
53 @retval EFI_SUCCESS The function completed successfully.
54
55 @retval EFI_NOT_FOUND The variable was not found.
56
57 @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the resulting data.
58 DataSize is updated with the size required for
59 the specified variable.
60
61 @retval EFI_INVALID_PARAMETER VariableName, VariableGuid, DataSize or Data is NULL.
62
63 @retval EFI_DEVICE_ERROR The variable could not be retrieved because of a device error.
64
65 **/
66 typedef
67 EFI_STATUS
68 (EFIAPI *EFI_PEI_GET_VARIABLE2)(
69 IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This,
70 IN CONST CHAR16 *VariableName,
71 IN CONST EFI_GUID *VariableGuid,
72 OUT UINT32 *Attributes,
73 IN OUT UINTN *DataSize,
74 OUT VOID *Data
75 );
76
77
78 /**
79 Return the next variable name and GUID.
80
81 This function is called multiple times to retrieve the VariableName
82 and VariableGuid of all variables currently available in the system.
83 On each call, the previous results are passed into the interface,
84 and, on return, the interface returns the data for the next
85 interface. When the entire variable list has been returned,
86 EFI_NOT_FOUND is returned.
87
88 @param This A pointer to this instance of the EFI_PEI_READ_ONLY_VARIABLE2_PPI.
89
90 @param VariableNameSize On entry, points to the size of the buffer pointed to by VariableName.
91
92 @param VariableName On entry, a pointer to a null-terminated string that is the variable's name.
93 On return, points to the next variable's null-terminated name string.
94
95 @param VendorGuid On entry, a pointer to an UEFI _GUID that is the variable's GUID.
96 On return, a pointer to the next variable's GUID.
97
98
99 @retval EFI_SUCCESS The variable was read successfully.
100
101 @retval EFI_NOT_FOUND The variable could not be found.
102
103 @retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the resulting
104 data. VariableNameSize is updated with the size
105 required for the specified variable.
106
107 @retval EFI_INVALID_PARAMETER VariableName, VariableGuid or
108 VariableNameSize is NULL.
109
110 @retval EFI_DEVICE_ERROR The variable could not be retrieved because of a device error.
111
112 **/
113 typedef
114 EFI_STATUS
115 (EFIAPI *EFI_PEI_NEXT_VARIABLE_NAME2)(
116 IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This,
117 IN OUT UINTN *VariableNameSize,
118 IN OUT CHAR16 *VariableName,
119 IN OUT EFI_GUID *VariableGuid
120 );
121
122 /**
123 This PPI provides a lightweight, read-only variant of the full EFI
124 variable services.
125
126 @param GetVariable
127 A service to ascertain a given variable name.
128
129 @param GetNextVariableName
130 A service to ascertain a variable based upon a given, known variable
131
132 **/
133 struct _EFI_PEI_READ_ONLY_VARIABLE2_PPI {
134 EFI_PEI_GET_VARIABLE2 GetVariable;
135 EFI_PEI_NEXT_VARIABLE_NAME2 NextVariableName;
136 };
137
138 extern EFI_GUID gEfiPeiReadOnlyVariable2PpiGuid;
139
140 #endif