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