]>
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 |
0047820e | 15 | This PPI is introduced in PI Version 1.0.\r |
5879b875 | 16 | \r |
17 | **/\r | |
18 | \r | |
19 | #ifndef __PEI_READ_ONLY_VARIABLE2_PPI_H__\r | |
20 | #define __PEI_READ_ONLY_VARIABLE2_PPI_H__\r | |
21 | \r | |
22 | #define EFI_PEI_READ_ONLY_VARIABLE2_PPI_GUID \\r | |
00edb218 | 23 | { 0x2ab86ef5, 0xecb5, 0x4134, { 0xb5, 0x56, 0x38, 0x54, 0xca, 0x1f, 0xe1, 0xb4 } }\r |
5879b875 | 24 | \r |
25 | \r | |
26 | typedef struct _EFI_PEI_READ_ONLY_VARIABLE2_PPI EFI_PEI_READ_ONLY_VARIABLE2_PPI;\r | |
27 | \r | |
28 | /**\r | |
d7132512 LG |
29 | This service retrieves a variable's value using its name and GUID.\r |
30 | \r | |
5879b875 | 31 | Read the specified variable from the UEFI variable store. If the Data \r |
00edb218 A |
32 | buffer is too small to hold the contents of the variable, \r |
33 | the error EFI_BUFFER_TOO_SMALL is returned and DataSize is set to the\r | |
34 | required buffer size to obtain the data.\r | |
5879b875 | 35 | \r |
13c38031 | 36 | @param This A pointer to this instance of the EFI_PEI_READ_ONLY_VARIABLE2_PPI.\r |
37 | @param VariableName A pointer to a null-terminated string that is the variable's name.\r | |
38 | @param VendorGuid A pointer to an EFI_GUID that is the variable's GUID. The combination of\r | |
39 | VariableGuid and VariableName must be unique.\r | |
40 | @param Attributes If non-NULL, on return, points to the variable's attributes.\r | |
41 | @param DataSize On entry, points to the size in bytes of the Data buffer.\r | |
42 | On return, points to the size of the data returned in Data.\r | |
43 | @param Data Points to the buffer which will hold the returned variable value.\r | |
5879b875 | 44 | \r |
13c38031 | 45 | @retval EFI_SUCCESS The variable was read successfully.\r |
46 | @retval EFI_NOT_FOUND The variable could not be found.\r | |
5879b875 | 47 | @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the resulting data. \r |
00edb218 A |
48 | DataSize is updated with the size required for \r |
49 | the specified variable.\r | |
5879b875 | 50 | @retval EFI_INVALID_PARAMETER VariableName, VariableGuid, DataSize or Data is NULL.\r |
5879b875 | 51 | @retval EFI_DEVICE_ERROR The variable could not be retrieved because of a device error.\r |
52 | \r | |
53 | **/\r | |
54 | typedef\r | |
55 | EFI_STATUS\r | |
56 | (EFIAPI *EFI_PEI_GET_VARIABLE2)(\r | |
00edb218 A |
57 | IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This,\r |
58 | IN CONST CHAR16 *VariableName,\r | |
59 | IN CONST EFI_GUID *VariableGuid,\r | |
60 | OUT UINT32 *Attributes,\r | |
61 | IN OUT UINTN *DataSize,\r | |
62 | OUT VOID *Data\r | |
ba237732 | 63 | );\r |
5879b875 | 64 | \r |
65 | \r | |
66 | /**\r | |
d7132512 LG |
67 | Return the next variable name and GUID.\r |
68 | \r | |
5879b875 | 69 | This function is called multiple times to retrieve the VariableName \r |
00edb218 A |
70 | and VariableGuid of all variables currently available in the system. \r |
71 | On each call, the previous results are passed into the interface, \r | |
72 | and, on return, the interface returns the data for the next \r | |
73 | interface. When the entire variable list has been returned, \r | |
74 | EFI_NOT_FOUND is returned.\r | |
5879b875 | 75 | \r |
00edb218 | 76 | @param This A pointer to this instance of the EFI_PEI_READ_ONLY_VARIABLE2_PPI.\r |
5879b875 | 77 | \r |
00edb218 | 78 | @param VariableNameSize On entry, points to the size of the buffer pointed to by VariableName.\r |
ac644614 | 79 | @param VariableName On entry, a pointer to a null-terminated string that is the variable's name.\r |
80 | On return, points to the next variable's null-terminated name string.\r | |
5879b875 | 81 | \r |
ac644614 | 82 | @param VendorGuid On entry, a pointer to an UEFI _GUID that is the variable's GUID. \r |
83 | On return, a pointer to the next variable's GUID.\r | |
5879b875 | 84 | \r |
5879b875 | 85 | @retval EFI_SUCCESS The variable was read successfully.\r |
5879b875 | 86 | @retval EFI_NOT_FOUND The variable could not be found.\r |
5879b875 | 87 | @retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the resulting\r |
00edb218 A |
88 | data. VariableNameSize is updated with the size\r |
89 | required for the specified variable.\r | |
5879b875 | 90 | @retval EFI_INVALID_PARAMETER VariableName, VariableGuid or\r |
00edb218 | 91 | VariableNameSize is NULL.\r |
5879b875 | 92 | @retval EFI_DEVICE_ERROR The variable could not be retrieved because of a device error.\r |
93 | \r | |
94 | **/\r | |
95 | typedef\r | |
96 | EFI_STATUS\r | |
8b13229b | 97 | (EFIAPI *EFI_PEI_NEXT_VARIABLE_NAME2)(\r |
00edb218 A |
98 | IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This,\r |
99 | IN OUT UINTN *VariableNameSize,\r | |
100 | IN OUT CHAR16 *VariableName,\r | |
101 | IN OUT EFI_GUID *VariableGuid\r | |
ba237732 | 102 | );\r |
5879b875 | 103 | \r |
13c38031 | 104 | ///\r |
105 | /// This PPI provides a lightweight, read-only variant of the full EFI \r | |
106 | /// variable services. \r | |
107 | ///\r | |
5879b875 | 108 | struct _EFI_PEI_READ_ONLY_VARIABLE2_PPI {\r |
00edb218 A |
109 | EFI_PEI_GET_VARIABLE2 GetVariable;\r |
110 | EFI_PEI_NEXT_VARIABLE_NAME2 NextVariableName;\r | |
5879b875 | 111 | };\r |
112 | \r | |
113 | extern EFI_GUID gEfiPeiReadOnlyVariable2PpiGuid;\r | |
114 | \r | |
115 | #endif\r |