3e5a3960 |
1 | /** @file\r |
2 | This file declares Read-only Variable Service PPI\r |
4a71b21a |
3 | These services provide a lightweight, read-only variant of the full EFI variable services. The\r |
4 | reason that these services are read-only is to reduce the complexity of flash management. Also,\r |
5 | some implementation of the PEI may use the same physical flash part for variable and PEIM\r |
6 | storage; as such, a write command to certain technologies would alter the contents of the entire part,\r |
7 | thus making the in situ PEIM execution not follow the required flow.\r |
3e5a3960 |
8 | \r |
b80fbe85 |
9 | Copyright (c) 2006, Intel Corporation\r |
10 | All rights reserved. This program and the accompanying materials\r |
11 | are licensed and made available under the terms and conditions of the BSD License\r |
12 | which accompanies this distribution. The full text of the license may be found at\r |
13 | http://opensource.org/licenses/bsd-license.php\r |
3e5a3960 |
14 | \r |
b80fbe85 |
15 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
16 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r |
3e5a3960 |
17 | \r |
18 | Module Name: ReadOnlyVariable.h\r |
19 | \r |
20 | @par Revision Reference:\r |
21 | This PPI is defined in PEI CIS\r |
22 | Version 0.91.\r |
23 | \r |
24 | **/\r |
25 | \r |
26 | #ifndef __PEI_READ_ONLY_VARIABLE_PPI_H__\r |
27 | #define __PEI_READ_ONLY_VARIABLE_PPI_H__\r |
28 | \r |
b80fbe85 |
29 | #include <PiPei.h>\r |
30 | \r |
3e5a3960 |
31 | #define EFI_PEI_READ_ONLY_VARIABLE_ACCESS_PPI_GUID \\r |
32 | { \\r |
33 | 0x3cdc90c6, 0x13fb, 0x4a75, {0x9e, 0x79, 0x59, 0xe9, 0xdd, 0x78, 0xb9, 0xfa } \\r |
34 | }\r |
35 | \r |
36 | typedef struct _EFI_PEI_READ_ONLY_VARIABLE_PPI EFI_PEI_READ_ONLY_VARIABLE_PPI;\r |
37 | \r |
38 | //\r |
39 | // Variable attributes\r |
40 | //\r |
41 | #define EFI_VARIABLE_NON_VOLATILE 0x00000001\r |
42 | #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002\r |
43 | #define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004\r |
44 | #define EFI_VARIABLE_READ_ONLY 0x00000008\r |
45 | \r |
46 | /**\r |
47 | Get Variable value by Name and GUID pair\r |
48 | \r |
49 | @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r |
50 | @param VariableName A NULL-terminated Unicode string that is the name of the vendor's variable.\r |
51 | @param VendorGuid A unique identifier for the vendor.\r |
52 | @param Attributes If not NULL, a pointer to the memory location to return\r |
53 | the attributes bitmask for the variable.\r |
54 | @param DataSize On input, the size in bytes of the return Data buffer.\r |
55 | On output, the size of data returned in Data.\r |
56 | @param Data The buffer to return the contents of the variable.\r |
57 | \r |
58 | @retval EFI_SUCCESS The function completed successfully.\r |
59 | @retval EFI_NOT_FOUND The variable was not found.\r |
60 | @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small for the result.\r |
61 | @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r |
62 | @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.\r |
63 | \r |
64 | **/\r |
65 | typedef\r |
66 | EFI_STATUS\r |
69686d56 |
67 | (EFIAPI *EFI_PEI_GET_VARIABLE)(\r |
3e5a3960 |
68 | IN EFI_PEI_SERVICES **PeiServices,\r |
69 | IN CHAR16 *VariableName,\r |
70 | IN EFI_GUID *VendorGuid,\r |
71 | OUT UINT32 *Attributes OPTIONAL,\r |
72 | IN OUT UINTN *DataSize,\r |
73 | OUT VOID *Data\r |
74 | );\r |
75 | \r |
76 | /**\r |
b80fbe85 |
77 | This function can be called multiple times to retrieve the VariableName\r |
78 | and VendorGuid of all variables currently available in the system. On each call\r |
79 | to GetNextVariableName() the previous results are passed into the interface,\r |
80 | and on output the interface returns the next variable name data. When the\r |
3e5a3960 |
81 | entire variable list has been returned, the error EFI_NOT_FOUND is returned.\r |
82 | \r |
83 | @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r |
84 | @param VariableNameSize The size of the VariableName buffer.\r |
85 | @param VariableName On input, supplies the last VariableName that was\r |
86 | returned by GetNextVariableName(). On output, returns the Null-terminated\r |
87 | Unicode string of the current variable.\r |
88 | @param VendorGuid On input, supplies the last VendorGuid that was\r |
89 | returned by GetNextVariableName(). On output, returns the VendorGuid\r |
90 | of the current variable.\r |
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 |
96 | @retval EFI_DEVICE_ERROR The variable name could not be retrieved due to a hardware error.\r |
97 | \r |
98 | **/\r |
99 | typedef\r |
100 | EFI_STATUS\r |
69686d56 |
101 | (EFIAPI *EFI_PEI_GET_NEXT_VARIABLE_NAME)(\r |
3e5a3960 |
102 | IN EFI_PEI_SERVICES **PeiServices,\r |
103 | IN OUT UINTN *VariableNameSize,\r |
104 | IN OUT CHAR16 *VariableName,\r |
105 | IN OUT EFI_GUID *VendorGuid\r |
106 | );\r |
107 | \r |
108 | /**\r |
109 | @par Ppi Description:\r |
b80fbe85 |
110 | This PPI provides a lightweight, read-only variant of the full EFI\r |
111 | variable services.\r |
3e5a3960 |
112 | \r |
113 | @param GetVariable\r |
114 | A service to ascertain a given variable name.\r |
115 | \r |
116 | @param GetNextVariableName\r |
117 | A service to ascertain a variable based upon a given, known variable\r |
118 | \r |
119 | **/\r |
120 | struct _EFI_PEI_READ_ONLY_VARIABLE_PPI {\r |
121 | EFI_PEI_GET_VARIABLE PeiGetVariable;\r |
122 | EFI_PEI_GET_NEXT_VARIABLE_NAME PeiGetNextVariableName;\r |
123 | };\r |
124 | \r |
125 | extern EFI_GUID gEfiPeiReadOnlyVariablePpiGuid;\r |
126 | \r |
127 | #endif\r |