--- /dev/null
+/** @file\r
+ This file declares Read-only Variable Service PPI\r
+\r
+ Copyright (c) 2006, Intel Corporation \r
+ All rights reserved. This program and the accompanying materials \r
+ are licensed and made available under the terms and conditions of the BSD License \r
+ which accompanies this distribution. The full text of the license may be found at \r
+ http://opensource.org/licenses/bsd-license.php \r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+\r
+ Module Name: ReadOnlyVariable.h\r
+\r
+ @par Revision Reference:\r
+ This PPI is defined in PEI CIS\r
+ Version 0.91.\r
+\r
+**/\r
+\r
+#ifndef __PEI_READ_ONLY_VARIABLE_PPI_H__\r
+#define __PEI_READ_ONLY_VARIABLE_PPI_H__\r
+\r
+#define EFI_PEI_READ_ONLY_VARIABLE_ACCESS_PPI_GUID \\r
+ { \\r
+ 0x3cdc90c6, 0x13fb, 0x4a75, {0x9e, 0x79, 0x59, 0xe9, 0xdd, 0x78, 0xb9, 0xfa } \\r
+ }\r
+\r
+typedef struct _EFI_PEI_READ_ONLY_VARIABLE_PPI EFI_PEI_READ_ONLY_VARIABLE_PPI;\r
+\r
+//\r
+// Variable attributes\r
+//\r
+#define EFI_VARIABLE_NON_VOLATILE 0x00000001\r
+#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002\r
+#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004\r
+#define EFI_VARIABLE_READ_ONLY 0x00000008\r
+\r
+/**\r
+ Get Variable value by Name and GUID pair\r
+\r
+ @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
+ @param VariableName A NULL-terminated Unicode string that is the name of the vendor's variable.\r
+ @param VendorGuid A unique identifier for the vendor.\r
+ @param Attributes If not NULL, a pointer to the memory location to return\r
+ the attributes bitmask for the variable.\r
+ @param DataSize On input, the size in bytes of the return Data buffer.\r
+ On output, the size of data returned in Data.\r
+ @param Data The buffer to return the contents of the variable.\r
+\r
+ @retval EFI_SUCCESS The function completed successfully.\r
+ @retval EFI_NOT_FOUND The variable was not found.\r
+ @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small for the result.\r
+ @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
+ @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_GET_VARIABLE) (\r
+ IN EFI_PEI_SERVICES **PeiServices,\r
+ IN CHAR16 *VariableName,\r
+ IN EFI_GUID *VendorGuid,\r
+ OUT UINT32 *Attributes OPTIONAL,\r
+ IN OUT UINTN *DataSize,\r
+ OUT VOID *Data\r
+ );\r
+\r
+/**\r
+ This function can be called multiple times to retrieve the VariableName \r
+ and VendorGuid of all variables currently available in the system. On each call \r
+ to GetNextVariableName() the previous results are passed into the interface, \r
+ and on output the interface returns the next variable name data. When the \r
+ entire variable list has been returned, the error EFI_NOT_FOUND is returned.\r
+\r
+ @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
+ @param VariableNameSize The size of the VariableName buffer.\r
+ @param VariableName On input, supplies the last VariableName that was\r
+ returned by GetNextVariableName(). On output, returns the Null-terminated\r
+ Unicode string of the current variable.\r
+ @param VendorGuid On input, supplies the last VendorGuid that was\r
+ returned by GetNextVariableName(). On output, returns the VendorGuid\r
+ of the current variable.\r
+\r
+ @retval EFI_SUCCESS The function completed successfully.\r
+ @retval EFI_NOT_FOUND The next variable was not found.\r
+ @retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the result.\r
+ @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
+ @retval EFI_DEVICE_ERROR The variable name could not be retrieved due to a hardware error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_GET_NEXT_VARIABLE_NAME) (\r
+ IN EFI_PEI_SERVICES **PeiServices,\r
+ IN OUT UINTN *VariableNameSize,\r
+ IN OUT CHAR16 *VariableName,\r
+ IN OUT EFI_GUID *VendorGuid\r
+ );\r
+\r
+/**\r
+ @par Ppi Description:\r
+ This PPI provides a lightweight, read-only variant of the full EFI \r
+ variable services. \r
+\r
+ @param GetVariable\r
+ A service to ascertain a given variable name.\r
+\r
+ @param GetNextVariableName\r
+ A service to ascertain a variable based upon a given, known variable\r
+\r
+**/\r
+struct _EFI_PEI_READ_ONLY_VARIABLE_PPI {\r
+ EFI_PEI_GET_VARIABLE PeiGetVariable;\r
+ EFI_PEI_GET_NEXT_VARIABLE_NAME PeiGetNextVariableName;\r
+};\r
+\r
+extern EFI_GUID gEfiPeiReadOnlyVariablePpiGuid;\r
+\r
+#endif\r