23 IN UINT8 ErasePolarity,
27 EFI_FFS_FILE_STATE FileState;
30 FileState = FfsHeader->State;
32 if (ErasePolarity != 0) {
33 FileState = (EFI_FFS_FILE_STATE) ~FileState;
37 while (HighestBit != 0 && ((HighestBit & FileState) == 0)) {
41 return (EFI_FFS_FILE_STATE)HighestBit;
57 IN UINT8 ErasePolarity,
66 if (ErasePolarity == 1) {
73 for (Count = 0; Count < BufferSize; Count++) {
74 if (Buffer[Count] != EraseByte) {
98 Checksum =
CalculateSum16 ((UINT16 *)FvHeader, FvHeader->HeaderLength);
121 UINT8 HeaderChecksum;
123 if (IS_FFS_FILE2 (FfsHeader)) {
129 HeaderChecksum = (UINT8)(HeaderChecksum - FfsHeader->State - FfsHeader->IntegrityCheck.Checksum.File);
131 if (HeaderChecksum == 0) {
151 IN UINT8 ErasePolarity,
153 OUT EFI_FFS_FILE_STATE *FileState
158 switch (*FileState) {
159 case EFI_FILE_HEADER_VALID:
160 case EFI_FILE_DATA_VALID:
161 case EFI_FILE_MARKED_FOR_UPDATE:
162 case EFI_FILE_DELETED:
169 case EFI_FILE_HEADER_INVALID:
188 IN UINT8 ErasePolarity,
192 EFI_FFS_FILE_STATE FileState;
197 case EFI_FILE_DELETED:
198 case EFI_FILE_DATA_VALID:
199 case EFI_FILE_MARKED_FOR_UPDATE:
201 if ((FfsHeader->Attributes & FFS_ATTRIB_CHECKSUM) == FFS_ATTRIB_CHECKSUM) {
202 if (IS_FFS_FILE2 (FfsHeader)) {
209 if (FfsHeader->IntegrityCheck.Checksum.File == DataCheckSum) {
UINT16 EFIAPI CalculateSum16(IN CONST UINT16 *Buffer, IN UINTN Length)
UINT8 EFIAPI CalculateSum8(IN CONST UINT8 *Buffer, IN UINTN Length)
UINT8 EFIAPI CalculateCheckSum8(IN CONST UINT8 *Buffer, IN UINTN Length)
EFI_FFS_FILE_STATE GetFileState(IN UINT8 ErasePolarity, 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)
BOOLEAN VerifyFvHeaderChecksum(IN EFI_FIRMWARE_VOLUME_HEADER *FvHeader)
BOOLEAN VerifyHeaderChecksum(IN EFI_FFS_FILE_HEADER *FfsHeader)
BOOLEAN IsBufferErased(IN UINT8 ErasePolarity, IN VOID *InBuffer, IN UINTN BufferSize)
#define EFI_FILE_HEADER_CONSTRUCTION
#define FFS_FIXED_CHECKSUM
#define FFS_FILE_SIZE(FfsFileHeaderPtr)