]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ppi/ReadOnlyVariable.h
1) Sync PcdPpi guid with PCD arch spec.
[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
44 @param VariableName A NULL-terminated Unicode string that is the name of the vendor¡¯s variable.
45
46 @param VendorGuid A unique identifier for the vendor.
47
48 @param Attributes If not NULL, a pointer to the memory location to return
49 the attributes bitmask for the variable.
50
51 @param DataSize On input, the size in bytes of the return Data buffer.
52 On output, the size of data returned in Data.
53
54 @param Data The buffer to return the contents of the variable.
55
56 @retval EFI_SUCCESS The function completed successfully.
57
58 @retval EFI_NOT_FOUND The variable was not found.
59
60 @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small for the result.
61
62 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
63
64 @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.
65
66 **/
67 typedef
68 EFI_STATUS
69 (EFIAPI *EFI_PEI_GET_VARIABLE) (
70 IN EFI_PEI_SERVICES **PeiServices,
71 IN CHAR16 *VariableName,
72 IN EFI_GUID *VendorGuid,
73 OUT UINT32 *Attributes OPTIONAL,
74 IN OUT UINTN *DataSize,
75 OUT VOID *Data
76 );
77
78 /**
79 This function can be called multiple times to retrieve the VariableName
80 and VendorGuid of all variables currently available in the system. On each call
81 to GetNextVariableName() the previous results are passed into the interface,
82 and on output the interface returns the next variable name data. When the
83 entire variable list has been returned, the error EFI_NOT_FOUND is returned.
84
85 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
86
87 @param VariableNameSize The size of the VariableName buffer.
88
89 @param VariableName On input, supplies the last VariableName that was
90 returned by GetNextVariableName(). On output, returns the Null-terminated
91 Unicode string of the current variable.
92
93 @param VendorGuid On input, supplies the last VendorGuid that was
94 returned by GetNextVariableName(). On output, returns the VendorGuid
95 of the current variable.
96
97 @retval EFI_SUCCESS The function completed successfully.
98
99 @retval EFI_NOT_FOUND The next variable was not found.
100
101 @retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the result.
102
103 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
104
105 @retval EFI_DEVICE_ERROR The variable name could not be retrieved due to a hardware error.
106
107 **/
108 typedef
109 EFI_STATUS
110 (EFIAPI *EFI_PEI_GET_NEXT_VARIABLE_NAME) (
111 IN EFI_PEI_SERVICES **PeiServices,
112 IN OUT UINTN *VariableNameSize,
113 IN OUT CHAR16 *VariableName,
114 IN OUT EFI_GUID *VendorGuid
115 );
116
117 /**
118 @par Ppi Description:
119 This PPI provides a lightweight, read-only variant of the full EFI
120 variable services.
121
122 @param GetVariable
123 A service to ascertain a given variable name.
124
125 @param GetNextVariableName
126 A service to ascertain a variable based upon a given, known variable
127
128 **/
129 struct _EFI_PEI_READ_ONLY_VARIABLE_PPI {
130 EFI_PEI_GET_VARIABLE PeiGetVariable;
131 EFI_PEI_GET_NEXT_VARIABLE_NAME PeiGetNextVariableName;
132 };
133
134 extern EFI_GUID gEfiPeiReadOnlyVariablePpiGuid;
135
136 #endif