]> git.proxmox.com Git - mirror_edk2.git/blame - SecurityPkg/VariableAuthenticated/RuntimeDxe/Variable.h
Nt32Pkg: Forbid creation of non-spec variables in EFI_GLOBAL_VARIABLE namespace.
[mirror_edk2.git] / SecurityPkg / VariableAuthenticated / RuntimeDxe / Variable.h
CommitLineData
0c18794e 1/** @file\r
2 The internal header file includes the common header files, defines\r
3 internal structure and functions used by Variable modules.\r
4\r
83758cdc 5Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
0c18794e 6This program and the accompanying materials \r
7are licensed and made available under the terms and conditions of the BSD License \r
8which accompanies this distribution. The full text of the license may be found at \r
9http://opensource.org/licenses/bsd-license.php\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#ifndef _VARIABLE_H_\r
17#define _VARIABLE_H_\r
18\r
19#include <PiDxe.h>\r
20#include <Protocol/VariableWrite.h>\r
21#include <Protocol/FaultTolerantWrite.h>\r
22#include <Protocol/FirmwareVolumeBlock.h>\r
23#include <Protocol/Variable.h>\r
6ab9f441 24#include <Protocol/VariableLock.h>\r
0c18794e 25#include <Library/PcdLib.h>\r
9a000b46 26#include <Library/HobLib.h>\r
0c18794e 27#include <Library/UefiDriverEntryPoint.h>\r
28#include <Library/DxeServicesTableLib.h>\r
29#include <Library/UefiRuntimeLib.h>\r
30#include <Library/DebugLib.h>\r
31#include <Library/BaseMemoryLib.h>\r
32#include <Library/UefiBootServicesTableLib.h>\r
33#include <Library/UefiLib.h>\r
34#include <Library/BaseLib.h>\r
35#include <Library/SynchronizationLib.h>\r
36#include <Library/MemoryAllocationLib.h>\r
37#include <Library/BaseCryptLib.h>\r
38#include <Library/PlatformSecureLib.h>\r
39#include <Guid/GlobalVariable.h>\r
40#include <Guid/EventGroup.h>\r
41#include <Guid/AuthenticatedVariableFormat.h>\r
42#include <Guid/ImageAuthentication.h>\r
4d832aab 43#include <Guid/SystemNvDataGuid.h>\r
039a40aa 44#include <Guid/FaultTolerantWrite.h>\r
a5f15e30 45#include <Guid/HardwareErrorVariable.h>\r
0c18794e 46\r
47#define VARIABLE_RECLAIM_THRESHOLD (1024)\r
275beb2b 48#define EFI_VARIABLE_ATTRIBUTES_MASK (EFI_VARIABLE_NON_VOLATILE | \\r
49 EFI_VARIABLE_BOOTSERVICE_ACCESS | \\r
50 EFI_VARIABLE_RUNTIME_ACCESS | \\r
51 EFI_VARIABLE_HARDWARE_ERROR_RECORD | \\r
52 EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS | \\r
53 EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS | \\r
54 EFI_VARIABLE_APPEND_WRITE)\r
0c18794e 55\r
56///\r
57/// The size of a 3 character ISO639 language code.\r
58///\r
59#define ISO_639_2_ENTRY_SIZE 3\r
60\r
9a000b46
RN
61typedef enum {\r
62 VariableStoreTypeVolatile,\r
63 VariableStoreTypeHob,\r
64 VariableStoreTypeNv,\r
65 VariableStoreTypeMax\r
66} VARIABLE_STORE_TYPE;\r
67\r
0c18794e 68typedef struct {\r
69 VARIABLE_HEADER *CurrPtr;\r
23b06935
SZ
70 //\r
71 // If both ADDED and IN_DELETED_TRANSITION variable are present,\r
72 // InDeletedTransitionPtr will point to the IN_DELETED_TRANSITION one.\r
73 // Otherwise, CurrPtr will point to the ADDED or IN_DELETED_TRANSITION one,\r
74 // and InDeletedTransitionPtr will be NULL at the same time.\r
75 //\r
76 VARIABLE_HEADER *InDeletedTransitionPtr;\r
0c18794e 77 VARIABLE_HEADER *EndPtr;\r
78 VARIABLE_HEADER *StartPtr;\r
79 BOOLEAN Volatile;\r
80} VARIABLE_POINTER_TRACK;\r
81\r
82typedef struct {\r
9a000b46 83 EFI_PHYSICAL_ADDRESS HobVariableBase;\r
0c18794e 84 EFI_PHYSICAL_ADDRESS VolatileVariableBase;\r
85 EFI_PHYSICAL_ADDRESS NonVolatileVariableBase;\r
86 EFI_LOCK VariableServicesLock;\r
87 UINT32 ReentrantState;\r
88} VARIABLE_GLOBAL;\r
89\r
90typedef struct {\r
91 VARIABLE_GLOBAL VariableGlobal;\r
92 UINTN VolatileLastVariableOffset;\r
93 UINTN NonVolatileLastVariableOffset;\r
94 UINTN CommonVariableTotalSize;\r
95 UINTN HwErrVariableTotalSize;\r
96 CHAR8 *PlatformLangCodes;\r
97 CHAR8 *LangCodes;\r
98 CHAR8 *PlatformLang;\r
99 CHAR8 Lang[ISO_639_2_ENTRY_SIZE + 1];\r
100 EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvbInstance;\r
101} VARIABLE_MODULE_GLOBAL;\r
102\r
103typedef struct {\r
104 EFI_GUID *Guid;\r
105 CHAR16 *Name;\r
106 UINT32 Attributes;\r
107 UINTN DataSize;\r
108 VOID *Data;\r
109} VARIABLE_CACHE_ENTRY;\r
110\r
6ab9f441
RN
111typedef struct {\r
112 EFI_GUID Guid;\r
113 CHAR16 *Name;\r
114 LIST_ENTRY Link;\r
115} VARIABLE_ENTRY;\r
116\r
335e2681
SZ
117/**\r
118 Flush the HOB variable to flash.\r
119\r
120 @param[in] VariableName Name of variable has been updated or deleted.\r
121 @param[in] VendorGuid Guid of variable has been updated or deleted.\r
122\r
123**/\r
124VOID\r
125FlushHobVariableToFlash (\r
126 IN CHAR16 *VariableName,\r
127 IN EFI_GUID *VendorGuid\r
128 );\r
129\r
0c18794e 130/**\r
131 Writes a buffer to variable storage space, in the working block.\r
132\r
133 This function writes a buffer to variable storage space into a firmware\r
134 volume block device. The destination is specified by the parameter\r
135 VariableBase. Fault Tolerant Write protocol is used for writing.\r
136\r
137 @param VariableBase Base address of the variable to write.\r
138 @param Buffer Point to the data buffer.\r
139 @param BufferSize The number of bytes of the data Buffer.\r
140\r
141 @retval EFI_SUCCESS The function completed successfully.\r
142 @retval EFI_NOT_FOUND Fail to locate Fault Tolerant Write protocol.\r
143 @retval EFI_ABORTED The function could not complete successfully.\r
144\r
145**/\r
146EFI_STATUS\r
147FtwVariableSpace (\r
148 IN EFI_PHYSICAL_ADDRESS VariableBase,\r
149 IN UINT8 *Buffer,\r
150 IN UINTN BufferSize\r
151 );\r
152\r
153/**\r
154 Finds variable in storage blocks of volatile and non-volatile storage areas.\r
155\r
156 This code finds variable in storage blocks of volatile and non-volatile storage areas.\r
157 If VariableName is an empty string, then we just return the first\r
158 qualified variable without comparing VariableName and VendorGuid.\r
9622df63
SZ
159 If IgnoreRtCheck is TRUE, then we ignore the EFI_VARIABLE_RUNTIME_ACCESS attribute check\r
160 at runtime when searching existing variable, only VariableName and VendorGuid are compared.\r
161 Otherwise, variables without EFI_VARIABLE_RUNTIME_ACCESS are not visible at runtime.\r
0c18794e 162\r
ecc722ad 163 @param[in] VariableName Name of the variable to be found.\r
164 @param[in] VendorGuid Vendor GUID to be found.\r
165 @param[out] PtrTrack VARIABLE_POINTER_TRACK structure for output,\r
0c18794e 166 including the range searched and the target position.\r
ecc722ad 167 @param[in] Global Pointer to VARIABLE_GLOBAL structure, including\r
0c18794e 168 base of volatile variable storage area, base of\r
169 NV variable storage area, and a lock.\r
9622df63
SZ
170 @param[in] IgnoreRtCheck Ignore EFI_VARIABLE_RUNTIME_ACCESS attribute\r
171 check at runtime when searching variable.\r
0c18794e 172\r
173 @retval EFI_INVALID_PARAMETER If VariableName is not an empty string, while\r
174 VendorGuid is NULL.\r
175 @retval EFI_SUCCESS Variable successfully found.\r
ecc722ad 176 @retval EFI_NOT_FOUND Variable not found\r
0c18794e 177\r
178**/\r
179EFI_STATUS\r
180FindVariable (\r
181 IN CHAR16 *VariableName,\r
182 IN EFI_GUID *VendorGuid,\r
183 OUT VARIABLE_POINTER_TRACK *PtrTrack,\r
ecc722ad 184 IN VARIABLE_GLOBAL *Global,\r
9622df63 185 IN BOOLEAN IgnoreRtCheck\r
0c18794e 186 );\r
187\r
188/**\r
189\r
190 This code gets the pointer to the variable data.\r
191\r
192 @param Variable Pointer to the Variable Header.\r
193\r
194 @return Pointer to Variable Data.\r
195\r
196**/\r
197UINT8 *\r
198GetVariableDataPtr (\r
199 IN VARIABLE_HEADER *Variable\r
200 );\r
201\r
202/**\r
203\r
204 This code gets the size of variable data.\r
205\r
206 @param Variable Pointer to the Variable Header.\r
207\r
208 @return Size of variable in bytes.\r
209\r
210**/\r
211UINTN\r
212DataSizeOfVariable (\r
213 IN VARIABLE_HEADER *Variable\r
214 );\r
215\r
216/**\r
217 Update the variable region with Variable information. If EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS is set,\r
218 index of associated public key is needed.\r
219\r
220 @param[in] VariableName Name of variable.\r
221 @param[in] VendorGuid Guid of variable.\r
222 @param[in] Data Variable data.\r
223 @param[in] DataSize Size of data. 0 means delete.\r
224 @param[in] Attributes Attributes of the variable.\r
225 @param[in] KeyIndex Index of associated public key.\r
226 @param[in] MonotonicCount Value of associated monotonic count.\r
23b06935 227 @param[in, out] Variable The variable information that is used to keep track of variable usage.\r
0c18794e 228\r
229 @param[in] TimeStamp Value of associated TimeStamp.\r
230\r
231 @retval EFI_SUCCESS The update operation is success.\r
232 @retval EFI_OUT_OF_RESOURCES Variable region is full, cannot write other data into this region.\r
233\r
234**/\r
235EFI_STATUS\r
236UpdateVariable (\r
237 IN CHAR16 *VariableName,\r
238 IN EFI_GUID *VendorGuid,\r
239 IN VOID *Data,\r
240 IN UINTN DataSize,\r
241 IN UINT32 Attributes OPTIONAL,\r
242 IN UINT32 KeyIndex OPTIONAL,\r
243 IN UINT64 MonotonicCount OPTIONAL,\r
23b06935 244 IN OUT VARIABLE_POINTER_TRACK *Variable,\r
0c18794e 245 IN EFI_TIME *TimeStamp OPTIONAL \r
246 );\r
247\r
248\r
249/**\r
250 Return TRUE if ExitBootServices () has been called.\r
251 \r
252 @retval TRUE If ExitBootServices () has been called.\r
253**/\r
254BOOLEAN\r
255AtRuntime (\r
256 VOID\r
257 );\r
258\r
259/**\r
260 Initializes a basic mutual exclusion lock.\r
261\r
262 This function initializes a basic mutual exclusion lock to the released state \r
263 and returns the lock. Each lock provides mutual exclusion access at its task \r
264 priority level. Since there is no preemption or multiprocessor support in EFI,\r
265 acquiring the lock only consists of raising to the locks TPL.\r
266 If Lock is NULL, then ASSERT().\r
267 If Priority is not a valid TPL value, then ASSERT().\r
268\r
269 @param Lock A pointer to the lock data structure to initialize.\r
270 @param Priority EFI TPL is associated with the lock.\r
271\r
272 @return The lock.\r
273\r
274**/\r
275EFI_LOCK *\r
276InitializeLock (\r
277 IN OUT EFI_LOCK *Lock,\r
278 IN EFI_TPL Priority\r
279 );\r
280\r
281 \r
282/**\r
283 Acquires lock only at boot time. Simply returns at runtime.\r
284\r
285 This is a temperary function that will be removed when\r
286 EfiAcquireLock() in UefiLib can handle the call in UEFI\r
287 Runtimer driver in RT phase.\r
288 It calls EfiAcquireLock() at boot time, and simply returns\r
289 at runtime.\r
290\r
291 @param Lock A pointer to the lock to acquire.\r
292\r
293**/\r
294VOID\r
295AcquireLockOnlyAtBootTime (\r
296 IN EFI_LOCK *Lock\r
297 );\r
298\r
299\r
300/**\r
301 Releases lock only at boot time. Simply returns at runtime.\r
302\r
303 This is a temperary function which will be removed when\r
304 EfiReleaseLock() in UefiLib can handle the call in UEFI\r
305 Runtimer driver in RT phase.\r
306 It calls EfiReleaseLock() at boot time and simply returns\r
307 at runtime.\r
308\r
309 @param Lock A pointer to the lock to release.\r
310\r
311**/\r
312VOID\r
313ReleaseLockOnlyAtBootTime (\r
314 IN EFI_LOCK *Lock\r
315 ); \r
316\r
317/**\r
318 Retrive the FVB protocol interface by HANDLE.\r
319\r
320 @param[in] FvBlockHandle The handle of FVB protocol that provides services for\r
321 reading, writing, and erasing the target block.\r
322 @param[out] FvBlock The interface of FVB protocol\r
323\r
324 @retval EFI_SUCCESS The interface information for the specified protocol was returned.\r
325 @retval EFI_UNSUPPORTED The device does not support the FVB protocol.\r
326 @retval EFI_INVALID_PARAMETER FvBlockHandle is not a valid EFI_HANDLE or FvBlock is NULL.\r
327 \r
328**/\r
329EFI_STATUS\r
330GetFvbByHandle (\r
331 IN EFI_HANDLE FvBlockHandle,\r
332 OUT EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL **FvBlock\r
333 );\r
334\r
335\r
336/**\r
337 Retrive the Swap Address Range protocol interface.\r
338\r
339 @param[out] SarProtocol The interface of SAR protocol\r
340\r
341 @retval EFI_SUCCESS The SAR protocol instance was found and returned in SarProtocol.\r
342 @retval EFI_NOT_FOUND The SAR protocol instance was not found.\r
343 @retval EFI_INVALID_PARAMETER SarProtocol is NULL.\r
344\r
345**/\r
346EFI_STATUS\r
347GetSarProtocol (\r
348 OUT VOID **SarProtocol\r
349 );\r
350\r
351/**\r
352 Function returns an array of handles that support the FVB protocol\r
353 in a buffer allocated from pool. \r
354\r
355 @param[out] NumberHandles The number of handles returned in Buffer.\r
356 @param[out] Buffer A pointer to the buffer to return the requested\r
357 array of handles that support FVB protocol.\r
358\r
359 @retval EFI_SUCCESS The array of handles was returned in Buffer, and the number of\r
360 handles in Buffer was returned in NumberHandles.\r
361 @retval EFI_NOT_FOUND No FVB handle was found.\r
362 @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the matching results.\r
363 @retval EFI_INVALID_PARAMETER NumberHandles is NULL or Buffer is NULL.\r
364 \r
365**/\r
366EFI_STATUS\r
367GetFvbCountAndBuffer (\r
368 OUT UINTN *NumberHandles,\r
369 OUT EFI_HANDLE **Buffer\r
370 );\r
371\r
372/**\r
373 Initializes variable store area for non-volatile and volatile variable.\r
374\r
375 @retval EFI_SUCCESS Function successfully executed.\r
376 @retval EFI_OUT_OF_RESOURCES Fail to allocate enough memory resource.\r
377\r
378**/\r
379EFI_STATUS\r
380VariableCommonInitialize (\r
381 VOID\r
382 );\r
383\r
83758cdc 384/**\r
385\r
386 Variable store garbage collection and reclaim operation.\r
387\r
388 If ReclaimPubKeyStore is FALSE, reclaim variable space by deleting the obsoleted varaibles.\r
389 If ReclaimPubKeyStore is TRUE, reclaim invalid key in public key database and update the PubKeyIndex\r
390 for all the count-based authenticate variable in NV storage.\r
391\r
ca5a7d87 392 @param[in] VariableBase Base address of variable store.\r
393 @param[out] LastVariableOffset Offset of last variable.\r
394 @param[in] IsVolatile The variable store is volatile or not;\r
395 if it is non-volatile, need FTW.\r
396 @param[in, out] UpdatingPtrTrack Pointer to updating variable pointer track structure.\r
397 @param[in] ReclaimPubKeyStore Reclaim for public key database or not.\r
398 @param[in] ReclaimAnyway If TRUE, do reclaim anyway.\r
83758cdc 399 \r
83758cdc 400 @return EFI_SUCCESS Reclaim operation has finished successfully.\r
ca5a7d87 401 @return EFI_OUT_OF_RESOURCES No enough memory resources.\r
402 @return EFI_DEVICE_ERROR The public key database doesn't exist.\r
83758cdc 403 @return Others Unexpect error happened during reclaim operation.\r
404\r
405**/\r
406EFI_STATUS\r
407Reclaim (\r
ca5a7d87 408 IN EFI_PHYSICAL_ADDRESS VariableBase,\r
409 OUT UINTN *LastVariableOffset,\r
410 IN BOOLEAN IsVolatile,\r
411 IN OUT VARIABLE_POINTER_TRACK *UpdatingPtrTrack,\r
412 IN BOOLEAN ReclaimPubKeyStore,\r
413 IN BOOLEAN ReclaimAnyway\r
83758cdc 414 );\r
415\r
0c18794e 416/**\r
417 This function reclaims variable storage if free size is below the threshold.\r
418 \r
419**/\r
420VOID\r
421ReclaimForOS(\r
422 VOID\r
423 ); \r
424\r
425\r
426/**\r
427 Initializes variable write service after FVB was ready.\r
428\r
429 @retval EFI_SUCCESS Function successfully executed.\r
430 @retval Others Fail to initialize the variable service.\r
431\r
432**/\r
433EFI_STATUS\r
434VariableWriteServiceInitialize (\r
435 VOID\r
436 );\r
437 \r
438/**\r
439 Retrive the SMM Fault Tolerent Write protocol interface.\r
440\r
441 @param[out] FtwProtocol The interface of SMM Ftw protocol\r
442\r
443 @retval EFI_SUCCESS The SMM SAR protocol instance was found and returned in SarProtocol.\r
444 @retval EFI_NOT_FOUND The SMM SAR protocol instance was not found.\r
445 @retval EFI_INVALID_PARAMETER SarProtocol is NULL.\r
446\r
447**/\r
448EFI_STATUS\r
449GetFtwProtocol (\r
450 OUT VOID **FtwProtocol\r
451 );\r
452\r
453/**\r
454 Get the proper fvb handle and/or fvb protocol by the given Flash address.\r
455\r
456 @param[in] Address The Flash address.\r
457 @param[out] FvbHandle In output, if it is not NULL, it points to the proper FVB handle.\r
458 @param[out] FvbProtocol In output, if it is not NULL, it points to the proper FVB protocol.\r
459\r
460**/\r
461EFI_STATUS\r
462GetFvbInfoByAddress (\r
463 IN EFI_PHYSICAL_ADDRESS Address,\r
464 OUT EFI_HANDLE *FvbHandle OPTIONAL,\r
465 OUT EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL **FvbProtocol OPTIONAL\r
466 );\r
467\r
468/**\r
469\r
470 This code finds variable in storage blocks (Volatile or Non-Volatile).\r
471\r
dc204d5a
JY
472 Caution: This function may receive untrusted input.\r
473 This function may be invoked in SMM mode, and datasize and data are external input.\r
474 This function will do basic validation, before parse the data.\r
475\r
0c18794e 476 @param VariableName Name of Variable to be found.\r
477 @param VendorGuid Variable vendor GUID.\r
478 @param Attributes Attribute value of the variable found.\r
479 @param DataSize Size of Data found. If size is less than the\r
480 data, this value contains the required size.\r
481 @param Data Data pointer.\r
482 \r
483 @return EFI_INVALID_PARAMETER Invalid parameter.\r
484 @return EFI_SUCCESS Find the specified variable.\r
485 @return EFI_NOT_FOUND Not found.\r
486 @return EFI_BUFFER_TO_SMALL DataSize is too small for the result.\r
487\r
488**/\r
489EFI_STATUS\r
490EFIAPI\r
491VariableServiceGetVariable (\r
492 IN CHAR16 *VariableName,\r
493 IN EFI_GUID *VendorGuid,\r
494 OUT UINT32 *Attributes OPTIONAL,\r
495 IN OUT UINTN *DataSize,\r
496 OUT VOID *Data\r
497 );\r
498\r
499/**\r
500\r
501 This code Finds the Next available variable.\r
502\r
dc204d5a
JY
503 Caution: This function may receive untrusted input.\r
504 This function may be invoked in SMM mode. This function will do basic validation, before parse the data.\r
505\r
0c18794e 506 @param VariableNameSize Size of the variable name.\r
507 @param VariableName Pointer to variable name.\r
508 @param VendorGuid Variable Vendor Guid.\r
509\r
510 @return EFI_INVALID_PARAMETER Invalid parameter.\r
511 @return EFI_SUCCESS Find the specified variable.\r
512 @return EFI_NOT_FOUND Not found.\r
513 @return EFI_BUFFER_TO_SMALL DataSize is too small for the result.\r
514\r
515**/\r
516EFI_STATUS\r
517EFIAPI\r
518VariableServiceGetNextVariableName (\r
519 IN OUT UINTN *VariableNameSize,\r
520 IN OUT CHAR16 *VariableName,\r
521 IN OUT EFI_GUID *VendorGuid\r
522 );\r
523\r
524/**\r
525\r
526 This code sets variable in storage blocks (Volatile or Non-Volatile).\r
527\r
dc204d5a
JY
528 Caution: This function may receive untrusted input.\r
529 This function may be invoked in SMM mode, and datasize and data are external input.\r
530 This function will do basic validation, before parse the data.\r
531 This function will parse the authentication carefully to avoid security issues, like\r
532 buffer overflow, integer overflow.\r
533 This function will check attribute carefully to avoid authentication bypass.\r
534\r
0c18794e 535 @param VariableName Name of Variable to be found.\r
536 @param VendorGuid Variable vendor GUID.\r
537 @param Attributes Attribute value of the variable found\r
538 @param DataSize Size of Data found. If size is less than the\r
539 data, this value contains the required size.\r
540 @param Data Data pointer.\r
541\r
542 @return EFI_INVALID_PARAMETER Invalid parameter.\r
543 @return EFI_SUCCESS Set successfully.\r
544 @return EFI_OUT_OF_RESOURCES Resource not enough to set variable.\r
545 @return EFI_NOT_FOUND Not found.\r
546 @return EFI_WRITE_PROTECTED Variable is read-only.\r
547\r
548**/\r
549EFI_STATUS\r
550EFIAPI\r
551VariableServiceSetVariable (\r
552 IN CHAR16 *VariableName,\r
553 IN EFI_GUID *VendorGuid,\r
554 IN UINT32 Attributes,\r
555 IN UINTN DataSize,\r
556 IN VOID *Data\r
557 );\r
558\r
559/**\r
560\r
561 This code returns information about the EFI variables.\r
562\r
dc204d5a
JY
563 Caution: This function may receive untrusted input.\r
564 This function may be invoked in SMM mode. This function will do basic validation, before parse the data.\r
565\r
0c18794e 566 @param Attributes Attributes bitmask to specify the type of variables\r
567 on which to return information.\r
568 @param MaximumVariableStorageSize Pointer to the maximum size of the storage space available\r
569 for the EFI variables associated with the attributes specified.\r
570 @param RemainingVariableStorageSize Pointer to the remaining size of the storage space available\r
571 for EFI variables associated with the attributes specified.\r
572 @param MaximumVariableSize Pointer to the maximum size of an individual EFI variables\r
573 associated with the attributes specified.\r
574\r
575 @return EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied.\r
576 @return EFI_SUCCESS Query successfully.\r
577 @return EFI_UNSUPPORTED The attribute is not supported on this platform.\r
578\r
579**/\r
580EFI_STATUS\r
581EFIAPI\r
582VariableServiceQueryVariableInfo (\r
583 IN UINT32 Attributes,\r
584 OUT UINT64 *MaximumVariableStorageSize,\r
585 OUT UINT64 *RemainingVariableStorageSize,\r
586 OUT UINT64 *MaximumVariableSize\r
587 ); \r
6ab9f441
RN
588\r
589/**\r
590 Mark a variable that will become read-only after leaving the DXE phase of execution.\r
591\r
592 @param[in] This The VARIABLE_LOCK_PROTOCOL instance.\r
593 @param[in] VariableName A pointer to the variable name that will be made read-only subsequently.\r
594 @param[in] VendorGuid A pointer to the vendor GUID that will be made read-only subsequently.\r
595\r
596 @retval EFI_SUCCESS The variable specified by the VariableName and the VendorGuid was marked\r
597 as pending to be read-only.\r
598 @retval EFI_INVALID_PARAMETER VariableName or VendorGuid is NULL.\r
599 Or VariableName is an empty string.\r
600 @retval EFI_ACCESS_DENIED EFI_END_OF_DXE_EVENT_GROUP_GUID or EFI_EVENT_GROUP_READY_TO_BOOT has\r
601 already been signaled.\r
602 @retval EFI_OUT_OF_RESOURCES There is not enough resource to hold the lock request.\r
603**/\r
604EFI_STATUS\r
605EFIAPI\r
606VariableLockRequestToLock (\r
607 IN CONST EDKII_VARIABLE_LOCK_PROTOCOL *This,\r
608 IN CHAR16 *VariableName,\r
609 IN EFI_GUID *VendorGuid\r
610 );\r
611\r
0c18794e 612extern VARIABLE_MODULE_GLOBAL *mVariableModuleGlobal;\r
613\r
614#endif\r