]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Ppi/ReadOnlyVariable.h
Remove IntelFrameworkModulePkg
[mirror_edk2.git] / IntelFrameworkPkg / Include / Ppi / ReadOnlyVariable.h
1 /** @file
2 This file declares the Read-only Variable Service PPI, which is required by the framework spec.
3
4 These services provide a lightweight, read-only variant of the full EFI variable services. The
5 reason that these services are read-only is to reduce the complexity of flash management. Also,
6 some implementation of the PEI may use the same physical flash part for variable and PEIM
7 storage. As such, a write command to certain technologies would alter the contents of the entire part,
8 making the PEIM execution in the original position not follow the required flow.
9
10 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
11 SPDX-License-Identifier: BSD-2-Clause-Patent
12
13 @par Revision Reference:
14 This PPI is defined in PEI CIS
15 Version 0.91.
16 **/
17
18 #ifndef __PEI_READ_ONLY_VARIABLE_PPI_H__
19 #define __PEI_READ_ONLY_VARIABLE_PPI_H__
20
21 #define EFI_PEI_READ_ONLY_VARIABLE_ACCESS_PPI_GUID \
22 { \
23 0x3cdc90c6, 0x13fb, 0x4a75, {0x9e, 0x79, 0x59, 0xe9, 0xdd, 0x78, 0xb9, 0xfa } \
24 }
25
26 typedef struct _EFI_PEI_READ_ONLY_VARIABLE_PPI EFI_PEI_READ_ONLY_VARIABLE_PPI;
27
28 ///
29 /// Variable attributes.
30 ///@{
31 #define EFI_VARIABLE_NON_VOLATILE 0x00000001
32 #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
33 #define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004
34 ///
35 /// Inconsistent with specification here:
36 /// In Framework Spec, PeiCis0.91, neither the macro or its value is defined.
37 /// Keeping this inconsistancy for backward compatibility.
38 ///
39 #define EFI_VARIABLE_READ_ONLY 0x00000008
40 ///@}
41
42 /**
43 Get Variable value by Name and GUID pair.
44
45 @param[in] PeiServices An indirect pointer to the PEI Services Table published
46 by the PEI Foundation.
47 @param[in] VariableName A NULL-terminated Unicode string that is the name of the vendor's variable.
48 @param[in] VendorGuid A unique identifier for the vendor.
49 @param[out] Attributes This OPTIONAL parameter may be either NULL or
50 a pointer to the location in which to return
51 the attributes bitmask for the variable.
52 @param[in,out] DataSize On input, the size in bytes of the return Data buffer.
53 On output, the size of data returned in Data.
54 @param[out] Data The buffer to return the contents of the variable.
55
56 @retval EFI_SUCCESS The function completed successfully.
57 @retval EFI_NOT_FOUND The variable was not found.
58 @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small for the result.
59 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
60 @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.
61
62 **/
63 typedef
64 EFI_STATUS
65 (EFIAPI *EFI_PEI_GET_VARIABLE)(
66 IN EFI_PEI_SERVICES **PeiServices,
67 IN CHAR16 *VariableName,
68 IN EFI_GUID *VendorGuid,
69 OUT UINT32 *Attributes OPTIONAL,
70 IN OUT UINTN *DataSize,
71 OUT VOID *Data
72 );
73
74 /**
75 This function can be called multiple times to retrieve the VariableName
76 and VendorGuid of all variables currently available in the system. On each call
77 to GetNextVariableName(), the previous results are passed into the interface,
78 and on output the interface returns the next variable name data. When the
79 entire variable list has been returned, the error EFI_NOT_FOUND is returned.
80
81 @param[in] PeiServices An indirect pointer to the PEI Services Table
82 published by the PEI Foundation.
83 @param[in] VariableNameSize The size of the VariableName buffer.
84 @param[in] VariableName On input, supplies the last VariableName that was
85 returned by GetNextVariableName(). On output,
86 returns the Null-terminated Unicode string of the
87 current variable.
88 @param[in] VendorGuid On input, supplies the last VendorGuid that was
89 returned by GetNextVariableName(). On output,
90 returns the VendorGuid of the current variable.
91
92 @retval EFI_SUCCESS The function completed successfully.
93 @retval EFI_NOT_FOUND The next variable was not found.
94 @retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the result.
95 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
96 @retval EFI_DEVICE_ERROR The variable name could not be retrieved due to
97 a hardware error.
98
99 **/
100 typedef
101 EFI_STATUS
102 (EFIAPI *EFI_PEI_GET_NEXT_VARIABLE_NAME)(
103 IN EFI_PEI_SERVICES **PeiServices,
104 IN OUT UINTN *VariableNameSize,
105 IN OUT CHAR16 *VariableName,
106 IN OUT EFI_GUID *VendorGuid
107 );
108
109 ///
110 /// This PPI provides a lightweight, read-only variant of the full EFI
111 /// variable services.
112 ///
113 struct _EFI_PEI_READ_ONLY_VARIABLE_PPI {
114 ///
115 /// Inconsistent with specification here:
116 /// In Framework Spec, PeiCis0.91, the field is named as GetVariable and GetNextVariableName.
117 /// Keeping this inconsistancy for backward compatibility.
118 ///
119 EFI_PEI_GET_VARIABLE PeiGetVariable; ///< A service to ascertain a given variable name.
120 EFI_PEI_GET_NEXT_VARIABLE_NAME PeiGetNextVariableName; ///< A service to ascertain a variable based upon a given, known variable
121 };
122
123 extern EFI_GUID gEfiPeiReadOnlyVariablePpiGuid;
124
125 #endif /* __PEI_READ_ONLY_VARIABLE_PPI_H__ */
126