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