]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | This file declares Read-only Variable Service PPI, which is required PPI by framework spec.\r | |
3 | \r | |
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 | |
7 | storage; as such, a write command to certain technologies would alter the contents of the entire part,\r | |
8 | thus making the in situ PEIM execution not follow the required flow.\r | |
9 | \r | |
10 | Copyright (c) 2006 - 2009, Intel Corporation\r | |
11 | All rights reserved. This program and the accompanying materials\r | |
12 | are licensed and made available under the terms and conditions of the BSD License\r | |
13 | which accompanies this distribution. The full text of the license may be found at\r | |
14 | http://opensource.org/licenses/bsd-license.php\r | |
15 | \r | |
16 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
17 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
18 | \r | |
19 | **/\r | |
20 | \r | |
21 | #ifndef __PEI_READ_ONLY_VARIABLE_PPI_H__\r | |
22 | #define __PEI_READ_ONLY_VARIABLE_PPI_H__\r | |
23 | \r | |
24 | #define EFI_PEI_READ_ONLY_VARIABLE_ACCESS_PPI_GUID \\r | |
25 | { \\r | |
26 | 0x3cdc90c6, 0x13fb, 0x4a75, {0x9e, 0x79, 0x59, 0xe9, 0xdd, 0x78, 0xb9, 0xfa } \\r | |
27 | }\r | |
28 | \r | |
29 | typedef struct _EFI_PEI_READ_ONLY_VARIABLE_PPI EFI_PEI_READ_ONLY_VARIABLE_PPI;\r | |
30 | \r | |
31 | //\r | |
32 | // Variable attributes\r | |
33 | //\r | |
34 | #define EFI_VARIABLE_NON_VOLATILE 0x00000001\r | |
35 | #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002\r | |
36 | #define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004\r | |
37 | ///\r | |
38 | /// Inconsistent with specification here: \r | |
39 | /// In Framework Spec, PeiCis0.91, there is no this field defined.\r | |
40 | /// Keeping this inconsistance is for backward compatibility.\r | |
41 | /// \r | |
42 | #define EFI_VARIABLE_READ_ONLY 0x00000008\r | |
43 | \r | |
44 | /**\r | |
45 | Get Variable value by Name and GUID pair\r | |
46 | \r | |
47 | @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r | |
48 | @param VariableName A NULL-terminated Unicode string that is the name of the vendor's variable.\r | |
49 | @param VendorGuid A unique identifier for the vendor.\r | |
50 | @param Attributes If not NULL, a pointer to the memory location to return\r | |
51 | the attributes bitmask for the variable.\r | |
52 | @param 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 Data The buffer to return the contents of the variable.\r | |
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 | |
63 | typedef\r | |
64 | EFI_STATUS\r | |
65 | (EFIAPI *EFI_PEI_GET_VARIABLE)(\r | |
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 | |
72 | );\r | |
73 | \r | |
74 | /**\r | |
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 | |
77 | to GetNextVariableName() the previous results are passed into the interface,\r | |
78 | and on output the interface returns the next variable name data. When the\r | |
79 | entire variable list has been returned, the error EFI_NOT_FOUND is returned.\r | |
80 | \r | |
81 | @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r | |
82 | @param VariableNameSize The size of the VariableName buffer.\r | |
83 | @param VariableName On input, supplies the last VariableName that was\r | |
84 | returned by GetNextVariableName(). On output, returns the Null-terminated\r | |
85 | Unicode string of the current variable.\r | |
86 | @param VendorGuid On input, supplies the last VendorGuid that was\r | |
87 | returned by GetNextVariableName(). On output, returns the VendorGuid\r | |
88 | of the current variable.\r | |
89 | \r | |
90 | @retval EFI_SUCCESS The function completed successfully.\r | |
91 | @retval EFI_NOT_FOUND The next variable was not found.\r | |
92 | @retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the result.\r | |
93 | @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r | |
94 | @retval EFI_DEVICE_ERROR The variable name could not be retrieved due to a hardware error.\r | |
95 | \r | |
96 | **/\r | |
97 | typedef\r | |
98 | EFI_STATUS\r | |
99 | (EFIAPI *EFI_PEI_GET_NEXT_VARIABLE_NAME)(\r | |
100 | IN EFI_PEI_SERVICES **PeiServices,\r | |
101 | IN OUT UINTN *VariableNameSize,\r | |
102 | IN OUT CHAR16 *VariableName,\r | |
103 | IN OUT EFI_GUID *VendorGuid\r | |
104 | );\r | |
105 | \r | |
106 | ///\r | |
107 | /// This PPI provides a lightweight, read-only variant of the full EFI\r | |
108 | /// variable services. \r | |
109 | ///\r | |
110 | struct _EFI_PEI_READ_ONLY_VARIABLE_PPI {\r | |
111 | ///\r | |
112 | /// Inconsistent with specification here: \r | |
113 | /// In Framework Spec, PeiCis0.91, the field is named as GetVariable and GetNextVariableName.\r | |
114 | /// Keeping this inconsistance is for backward compatibility.\r | |
115 | /// \r | |
116 | EFI_PEI_GET_VARIABLE PeiGetVariable; ///< A service to ascertain a given variable name.\r | |
117 | EFI_PEI_GET_NEXT_VARIABLE_NAME PeiGetNextVariableName; ///< A service to ascertain a variable based upon a given, known variable\r | |
118 | };\r | |
119 | \r | |
120 | extern EFI_GUID gEfiPeiReadOnlyVariablePpiGuid;\r | |
121 | \r | |
122 | #endif\r |