TianoCore EDK2 master
|
#include "NvVarsFileLib.h"
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
Go to the source code of this file.
Functions | |
EFI_STATUS | GetNvVarsFile (IN EFI_HANDLE FsHandle, IN BOOLEAN ReadingFile, OUT EFI_FILE_HANDLE *NvVarsFile) |
VOID | NvVarsFileReadCheckup (IN EFI_FILE_HANDLE File, OUT BOOLEAN *Exists, OUT UINTN *Size) |
EFI_STATUS | FileHandleEmpty (IN EFI_FILE_HANDLE File) |
VOID * | FileHandleReadToNewBuffer (IN EFI_FILE_HANDLE FileHandle, IN UINTN ReadSize) |
EFI_STATUS | ReadNvVarsFile (IN EFI_HANDLE FsHandle) |
STATIC VOID | SetNvVarsVariable (VOID) |
EFI_STATUS | LoadNvVarsFromFs (EFI_HANDLE FsHandle) |
STATIC RETURN_STATUS EFIAPI | IterateVariablesCallbackAddAllNvVariables (IN VOID *Context, IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data) |
EFI_STATUS | SaveNvVarsToFs (EFI_HANDLE FsHandle) |
File System Access for NvVarsFileLib
Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file FsAccess.c.
EFI_STATUS FileHandleEmpty | ( | IN EFI_FILE_HANDLE | File | ) |
Open the NvVars file for reading or writing
[in] | File | - The file to inspect |
[out] | Exists | - Returns whether the file exists |
[out] | Size | - Returns the size of the file (0 if the file does not exist) |
Definition at line 124 of file FsAccess.c.
VOID * FileHandleReadToNewBuffer | ( | IN EFI_FILE_HANDLE | FileHandle, |
IN UINTN | ReadSize | ||
) |
Reads a file to a newly allocated buffer
[in] | File | - The file to read |
[in] | ReadSize | - The size of data to read from the file |
Definition at line 178 of file FsAccess.c.
EFI_STATUS GetNvVarsFile | ( | IN EFI_HANDLE | FsHandle, |
IN BOOLEAN | ReadingFile, | ||
OUT EFI_FILE_HANDLE * | NvVarsFile | ||
) |
Open the NvVars file for reading or writing
[in] | FsHandle | - Handle for a gEfiSimpleFileSystemProtocolGuid instance |
[in] | ReadingFile | - TRUE: open the file for reading. FALSE: writing |
[out] | NvVarsFile | - If EFI_SUCCESS is returned, then this is updated with the opened NvVars file. |
Definition at line 27 of file FsAccess.c.
STATIC RETURN_STATUS EFIAPI IterateVariablesCallbackAddAllNvVariables | ( | IN VOID * | Context, |
IN CHAR16 * | VariableName, | ||
IN EFI_GUID * | VendorGuid, | ||
IN UINT32 | Attributes, | ||
IN UINTN | DataSize, | ||
IN VOID * | Data | ||
) |
Definition at line 366 of file FsAccess.c.
EFI_STATUS LoadNvVarsFromFs | ( | EFI_HANDLE | FsHandle | ) |
Loads the non-volatile variables from the NvVars file on the given file system.
[in] | FsHandle | - Handle for a gEfiSimpleFileSystemProtocolGuid instance |
Definition at line 305 of file FsAccess.c.
VOID NvVarsFileReadCheckup | ( | IN EFI_FILE_HANDLE | File, |
OUT BOOLEAN * | Exists, | ||
OUT UINTN * | Size | ||
) |
Open the NvVars file for reading or writing
[in] | File | - The file to inspect |
[out] | Exists | - Returns whether the file exists |
[out] | Size | - Returns the size of the file (0 if the file does not exist) |
Definition at line 87 of file FsAccess.c.
EFI_STATUS ReadNvVarsFile | ( | IN EFI_HANDLE | FsHandle | ) |
Reads the contents of the NvVars file on the file system
[in] | FsHandle | - Handle for a gEfiSimpleFileSystemProtocolGuid instance |
Definition at line 213 of file FsAccess.c.
EFI_STATUS SaveNvVarsToFs | ( | EFI_HANDLE | FsHandle | ) |
Saves the non-volatile variables into the NvVars file on the given file system.
[in] | FsHandle | - Handle for a gEfiSimpleFileSystemProtocolGuid instance |
Definition at line 406 of file FsAccess.c.
STATIC VOID SetNvVarsVariable | ( | VOID | ) |
Writes a variable to indicate that the NV variables have been loaded from the file system.
Definition at line 270 of file FsAccess.c.