2 Save Non-Volatile Variables to a file system.
4 Copyright (c) 2009, 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
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.
15 #ifndef __NV_VARS_FILE_LIB_INSTANCE__
16 #define __NV_VARS_FILE_LIB_INSTANCE__
20 #include <Guid/FileInfo.h>
22 #include <Protocol/SimpleFileSystem.h>
24 #include <Library/BaseLib.h>
25 #include <Library/FileHandleLib.h>
26 #include <Library/UefiBootServicesTableLib.h>
27 #include <Library/UefiRuntimeServicesTableLib.h>
28 #include <Library/UefiLib.h>
31 Loads the non-volatile variables from the NvVars file on the
34 @param[in] FsHandle - Handle for a gEfiSimpleFileSystemProtocolGuid instance
36 @return EFI_STATUS based on the success or failure of load operation
46 Saves the non-volatile variables into the NvVars file on the
49 @param[in] FsHandle - Handle for a gEfiSimpleFileSystemProtocolGuid instance
51 @return EFI_STATUS based on the success or failure of load operation
61 Examines the NvVars file contents, and updates variables based on it.
63 @param[in] VarsBuffer - Buffer with NvVars data
64 @param[in] VarsBufferSize - Size of VarsBuffer in bytes
66 @return EFI_STATUS based on the success or failure of the operation
70 SetVariablesFromBuffer (
72 IN UINTN VarsBufferSize
77 Writes the variable into the file so it can be restored from
78 the file on future boots of the system.
80 @param[in] File - The file to write to
81 @param[in] Name - Variable name string
82 @param[in] NameSize - Size of Name in bytes
83 @param[in] Guid - GUID of variable
84 @param[in] Attributes - Attributes of variable
85 @param[in] Data - Buffer containing Data for variable
86 @param[in] DataSize - Size of Data in bytes
88 @return EFI_STATUS based on the success or failure of the operation
92 PackVariableIntoFile (
93 IN EFI_FILE_HANDLE File
,