]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ppi/ReadOnlyVariable2.h
Removed IntelframeworkPkg contamination from MdeModulePkg modules.
[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 @par Revision Reference:
14 This PPI is defined in PI
15 Version 1.00.
16
17 **/
18
19 #ifndef __PEI_READ_ONLY_VARIABLE2_PPI_H__
20 #define __PEI_READ_ONLY_VARIABLE2_PPI_H__
21
22 #define EFI_PEI_READ_ONLY_VARIABLE2_PPI_GUID \
23 { 0x2ab86ef5, 0xecb5, 0x4134, { 0xb5, 0x56, 0x38, 0x54, 0xca, 0x1f, 0xe1, 0xb4 } }
24
25
26 typedef struct _EFI_PEI_READ_ONLY_VARIABLE2_PPI EFI_PEI_READ_ONLY_VARIABLE2_PPI;
27
28 /**
29 Read the specified variable from the UEFI variable store. If the Data
30 buffer is too small to hold the contents of the variable,
31 the error EFI_BUFFER_TOO_SMALL is returned and DataSize is set to the
32 required buffer size to obtain the data.
33
34 @param This A pointer to this instance of the EFI_PEI_READ_ONLY_VARIABLE2_PPI.
35
36 @param VariableName A pointer to a null-terminated string that is the variable¡¯s name.
37
38 @param VendorGuid A pointer to an EFI_GUID that is the variable¡¯s GUID. The combination of
39 VariableGuid and VariableName must be unique.
40
41 @param Attributes If non-NULL, on return, points to the variable¡¯s attributes. See ¡°Related Definitons¡±
42 below for possible attribute values.
43
44 @param DataSize On entry, points to the size in bytes of the Data buffer. On return, points to the size of
45 the data returned in Data.
46
47 @param Data Points to the buffer which will hold the returned variable value.
48
49
50 @retval EFI_SUCCESS The function completed successfully.
51
52 @retval EFI_NOT_FOUND The variable was not found.
53
54 @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the resulting data.
55 DataSize is updated with the size required for
56 the specified variable.
57
58 @retval EFI_INVALID_PARAMETER VariableName, VariableGuid, DataSize or Data is NULL.
59
60 @retval EFI_DEVICE_ERROR The variable could not be retrieved because of a device error.
61
62 **/
63 typedef
64 EFI_STATUS
65 (EFIAPI *EFI_PEI_GET_VARIABLE2)(
66 IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This,
67 IN CONST CHAR16 *VariableName,
68 IN CONST EFI_GUID *VariableGuid,
69 OUT UINT32 *Attributes,
70 IN OUT UINTN *DataSize,
71 OUT VOID *Data
72 );
73
74
75 /**
76 This function is called multiple times to retrieve the VariableName
77 and VariableGuid of all variables currently available in the system.
78 On each call, the previous results are passed into the interface,
79 and, on return, the interface returns the data for the next
80 interface. When the entire variable list has been returned,
81 EFI_NOT_FOUND is returned.
82
83 @param This A pointer to this instance of the EFI_PEI_READ_ONLY_VARIABLE2_PPI.
84
85 @param VariableNameSize On entry, points to the size of the buffer pointed to by VariableName.
86
87 @param VariableName On entry, a pointer to a null-terminated string that is the variable¡¯s name.
88 On return, points to the next variable¡¯s null-terminated name string.
89
90 @param VendorGuid On entry, a pointer to an UEFI _GUID that is the variable¡¯s GUID.
91 On return, a pointer to the next variable¡¯s GUID.
92
93
94 @retval EFI_SUCCESS The variable was read successfully.
95
96 @retval EFI_NOT_FOUND The variable could not be found.
97
98 @retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the resulting
99 data. VariableNameSize is updated with the size
100 required for the specified variable.
101
102 @retval EFI_INVALID_PARAMETER VariableName, VariableGuid or
103 VariableNameSize is NULL.
104
105 @retval EFI_DEVICE_ERROR The variable could not be retrieved because of a device error.
106
107 **/
108 typedef
109 EFI_STATUS
110 (EFIAPI *EFI_PEI_NEXT_VARIABLE_NAME2) (
111 IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This,
112 IN OUT UINTN *VariableNameSize,
113 IN OUT CHAR16 *VariableName,
114 IN OUT EFI_GUID *VariableGuid
115 );
116
117 /**
118 This PPI provides a lightweight, read-only variant of the full EFI
119 variable services.
120
121 @param GetVariable
122 A service to ascertain a given variable name.
123
124 @param GetNextVariableName
125 A service to ascertain a variable based upon a given, known variable
126
127 **/
128 struct _EFI_PEI_READ_ONLY_VARIABLE2_PPI {
129 EFI_PEI_GET_VARIABLE2 GetVariable;
130 EFI_PEI_NEXT_VARIABLE_NAME2 NextVariableName;
131 };
132
133 extern EFI_GUID gEfiPeiReadOnlyVariable2PpiGuid;
134
135 #endif