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