TianoCore EDK2 master
Loading...
Searching...
No Matches
Ffs.c File Reference
#include "DxeMain.h"
#include "FwVolDriver.h"

Go to the source code of this file.

Functions

EFI_FFS_FILE_STATE GetFileState (IN UINT8 ErasePolarity, IN EFI_FFS_FILE_HEADER *FfsHeader)
 
BOOLEAN IsBufferErased (IN UINT8 ErasePolarity, IN VOID *InBuffer, IN UINTN BufferSize)
 
BOOLEAN VerifyFvHeaderChecksum (IN EFI_FIRMWARE_VOLUME_HEADER *FvHeader)
 
BOOLEAN VerifyHeaderChecksum (IN EFI_FFS_FILE_HEADER *FfsHeader)
 
BOOLEAN IsValidFfsHeader (IN UINT8 ErasePolarity, IN EFI_FFS_FILE_HEADER *FfsHeader, OUT EFI_FFS_FILE_STATE *FileState)
 
BOOLEAN IsValidFfsFile (IN UINT8 ErasePolarity, IN EFI_FFS_FILE_HEADER *FfsHeader)
 

Detailed Description

FFS file access utilities.

Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Ffs.c.

Function Documentation

◆ GetFileState()

EFI_FFS_FILE_STATE GetFileState ( IN UINT8  ErasePolarity,
IN EFI_FFS_FILE_HEADER FfsHeader 
)

Get the FFS file state by checking the highest bit set in the header's state field.

Parameters
ErasePolarityErase polarity attribute of the firmware volume
FfsHeaderPoints to the FFS file header
Returns
FFS File state

Definition at line 22 of file Ffs.c.

◆ IsBufferErased()

BOOLEAN IsBufferErased ( IN UINT8  ErasePolarity,
IN VOID *  InBuffer,
IN UINTN  BufferSize 
)

Check if a block of buffer is erased.

Parameters
ErasePolarityErase polarity attribute of the firmware volume
InBufferThe buffer to be checked
BufferSizeSize of the buffer in bytes
Return values
TRUEThe block of buffer is erased
FALSEThe block of buffer is not erased

Definition at line 56 of file Ffs.c.

◆ IsValidFfsFile()

BOOLEAN IsValidFfsFile ( IN UINT8  ErasePolarity,
IN EFI_FFS_FILE_HEADER FfsHeader 
)

Check if it's a valid FFS file. Here we are sure that it has a valid FFS file header since we must call IsValidFfsHeader() first.

Parameters
ErasePolarityErase polarity attribute of the firmware volume
FfsHeaderPoints to the FFS file to be checked
Return values
TRUEValid FFS file
FALSEInvalid FFS file

Definition at line 187 of file Ffs.c.

◆ IsValidFfsHeader()

BOOLEAN IsValidFfsHeader ( IN UINT8  ErasePolarity,
IN EFI_FFS_FILE_HEADER FfsHeader,
OUT EFI_FFS_FILE_STATE *  FileState 
)

Check if it's a valid FFS file header.

Parameters
ErasePolarityErase polarity attribute of the firmware volume
FfsHeaderPoints to the FFS file header to be checked
FileStateFFS file state to be returned
Return values
TRUEValid FFS file header
FALSEInvalid FFS file header

Definition at line 150 of file Ffs.c.

◆ VerifyFvHeaderChecksum()

BOOLEAN VerifyFvHeaderChecksum ( IN EFI_FIRMWARE_VOLUME_HEADER FvHeader)

Verify checksum of the firmware volume header.

Parameters
FvHeaderPoints to the firmware volume header to be checked
Return values
TRUEChecksum verification passed
FALSEChecksum verification failed

Definition at line 92 of file Ffs.c.

◆ VerifyHeaderChecksum()

BOOLEAN VerifyHeaderChecksum ( IN EFI_FFS_FILE_HEADER FfsHeader)

Verify checksum of the FFS file header.

Parameters
FfsHeaderPoints to the FFS file header to be checked
Return values
TRUEChecksum verification passed
FALSEChecksum verification failed

Definition at line 117 of file Ffs.c.