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