]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Variable/Pei/Variable.h
Remove duplicated definitions EFI_VARIABLE_INDEX_TABLE_GUID in variable PEI drivers.
[mirror_edk2.git] / MdeModulePkg / Universal / Variable / Pei / Variable.h
1 /** @file
2
3 The internal header file includes the common header files, defines
4 internal structure and functions used by PeiVariable module.
5
6 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
7 This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 **/
16
17 #ifndef _PEI_VARIABLE_H_
18 #define _PEI_VARIABLE_H_
19
20 #include <PiPei.h>
21 #include <Ppi/ReadOnlyVariable2.h>
22
23 #include <Library/DebugLib.h>
24 #include <Library/PeimEntryPoint.h>
25 #include <Library/HobLib.h>
26 #include <Library/PcdLib.h>
27 #include <Library/BaseMemoryLib.h>
28 #include <Library/PeiServicesTablePointerLib.h>
29 #include <Library/PeiServicesLib.h>
30
31 #include <Guid/VariableFormat.h>
32 #include <Guid/VariableIndexTable.h>
33 //
34 // Functions
35 //
36 /**
37 Provide the functionality of the variable services.
38
39 @param FileHandle Handle of the file being invoked.
40 Type EFI_PEI_FILE_HANDLE is defined in FfsFindNextFile().
41 @param PeiServices General purpose services available to every PEIM.
42
43 @retval EFI_SUCCESS If the interface could be successfully installed
44 @retval Others Returned from PeiServicesInstallPpi()
45
46 **/
47 EFI_STATUS
48 EFIAPI
49 PeimInitializeVariableServices (
50 IN EFI_PEI_FILE_HANDLE FileHandle,
51 IN CONST EFI_PEI_SERVICES **PeiServices
52 );
53
54 /**
55 This service retrieves a variable's value using its name and GUID.
56
57 Read the specified variable from the UEFI variable store. If the Data
58 buffer is too small to hold the contents of the variable, the error
59 EFI_BUFFER_TOO_SMALL is returned and DataSize is set to the required buffer
60 size to obtain the data.
61
62 @param This A pointer to this instance of the EFI_PEI_READ_ONLY_VARIABLE2_PPI.
63 @param VariableName A pointer to a null-terminated string that is the variable's name.
64 @param VariableGuid A pointer to an EFI_GUID that is the variable's GUID. The combination of
65 VariableGuid and VariableName must be unique.
66 @param Attributes If non-NULL, on return, points to the variable's attributes.
67 @param DataSize On entry, points to the size in bytes of the Data buffer.
68 On return, points to the size of the data returned in Data.
69 @param Data Points to the buffer which will hold the returned variable value.
70
71 @retval EFI_SUCCESS The variable was read successfully.
72 @retval EFI_NOT_FOUND The variable could not be found.
73 @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the resulting data.
74 DataSize is updated with the size required for
75 the specified variable.
76 @retval EFI_INVALID_PARAMETER VariableName, VariableGuid, DataSize or Data is NULL.
77 @retval EFI_DEVICE_ERROR The variable could not be retrieved because of a device error.
78
79 **/
80 EFI_STATUS
81 EFIAPI
82 PeiGetVariable (
83 IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This,
84 IN CONST CHAR16 *VariableName,
85 IN CONST EFI_GUID *VariableGuid,
86 OUT UINT32 *Attributes,
87 IN OUT UINTN *DataSize,
88 OUT VOID *Data
89 );
90
91 /**
92 Return the next variable name and GUID.
93
94 This function is called multiple times to retrieve the VariableName
95 and VariableGuid of all variables currently available in the system.
96 On each call, the previous results are passed into the interface,
97 and, on return, the interface returns the data for the next
98 interface. When the entire variable list has been returned,
99 EFI_NOT_FOUND is returned.
100
101 @param This A pointer to this instance of the EFI_PEI_READ_ONLY_VARIABLE2_PPI.
102
103 @param VariableNameSize On entry, points to the size of the buffer pointed to by VariableName.
104 @param VariableName On entry, a pointer to a null-terminated string that is the variable's name.
105 On return, points to the next variable's null-terminated name string.
106
107 @param VariableGuid On entry, a pointer to an UEFI _GUID that is the variable's GUID.
108 On return, a pointer to the next variable's GUID.
109
110 @retval EFI_SUCCESS The variable was read successfully.
111 @retval EFI_NOT_FOUND The variable could not be found.
112 @retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the resulting
113 data. VariableNameSize is updated with the size
114 required for the specified variable.
115 @retval EFI_INVALID_PARAMETER VariableName, VariableGuid or
116 VariableNameSize is NULL.
117 @retval EFI_DEVICE_ERROR The variable could not be retrieved because of a device error.
118
119 **/
120 EFI_STATUS
121 EFIAPI
122 PeiGetNextVariableName (
123 IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This,
124 IN OUT UINTN *VariableNameSize,
125 IN OUT CHAR16 *VariableName,
126 IN OUT EFI_GUID *VariableGuid
127 );
128
129 #endif