TianoCore EDK2 master
Loading...
Searching...
No Matches
FsAccess.c File Reference

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)
 

Detailed Description

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.

Function Documentation

◆ FileHandleEmpty()

EFI_STATUS FileHandleEmpty ( IN EFI_FILE_HANDLE  File)

Open the NvVars file for reading or writing

Parameters
[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.

◆ FileHandleReadToNewBuffer()

VOID * FileHandleReadToNewBuffer ( IN EFI_FILE_HANDLE  FileHandle,
IN UINTN  ReadSize 
)

Reads a file to a newly allocated buffer

Parameters
[in]File- The file to read
[in]ReadSize- The size of data to read from the file
Returns
Pointer to buffer allocated to hold the file contents. NULL if an error occurred.

Definition at line 178 of file FsAccess.c.

◆ GetNvVarsFile()

EFI_STATUS GetNvVarsFile ( IN EFI_HANDLE  FsHandle,
IN BOOLEAN  ReadingFile,
OUT EFI_FILE_HANDLE NvVarsFile 
)

Open the NvVars file for reading or writing

Parameters
[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.
Returns
EFI_SUCCESS if the file was opened

Definition at line 27 of file FsAccess.c.

◆ IterateVariablesCallbackAddAllNvVariables()

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.

◆ LoadNvVarsFromFs()

EFI_STATUS LoadNvVarsFromFs ( EFI_HANDLE  FsHandle)

Loads the non-volatile variables from the NvVars file on the given file system.

Parameters
[in]FsHandle- Handle for a gEfiSimpleFileSystemProtocolGuid instance
Returns
EFI_STATUS based on the success or failure of load operation

Definition at line 305 of file FsAccess.c.

◆ NvVarsFileReadCheckup()

VOID NvVarsFileReadCheckup ( IN EFI_FILE_HANDLE  File,
OUT BOOLEAN *  Exists,
OUT UINTN Size 
)

Open the NvVars file for reading or writing

Parameters
[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.

◆ ReadNvVarsFile()

EFI_STATUS ReadNvVarsFile ( IN EFI_HANDLE  FsHandle)

Reads the contents of the NvVars file on the file system

Parameters
[in]FsHandle- Handle for a gEfiSimpleFileSystemProtocolGuid instance
Returns
EFI_STATUS based on the success or failure of the file read

Definition at line 213 of file FsAccess.c.

◆ SaveNvVarsToFs()

EFI_STATUS SaveNvVarsToFs ( EFI_HANDLE  FsHandle)

Saves the non-volatile variables into the NvVars file on the given file system.

Parameters
[in]FsHandle- Handle for a gEfiSimpleFileSystemProtocolGuid instance
Returns
EFI_STATUS based on the success or failure of load operation

Definition at line 406 of file FsAccess.c.

◆ SetNvVarsVariable()

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.