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