MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / GetFileState

Function GetFileState

BaseTools/Source/C/Common/FvLib.c:889–927  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

887}
888
889UINT8
890GetFileState (
891 IN BOOLEAN ErasePolarity,
892 IN EFI_FFS_FILE_HEADER *FfsHeader
893 )
894/*++
895
896Routine Description:
897
898 This function returns a the highest state bit in the FFS that is set.
899 It in no way validate the FFS file.
900
901Arguments:
902
903 ErasePolarity The erase polarity for the file state bits.
904 FfsHeader Pointer to a FFS file.
905
906Returns:
907
908 UINT8 The hightest set state of the file.
909
910--*/
911{
912 UINT8 FileState;
913 UINT8 HighestBit;
914
915 FileState = FfsHeader->State;
916
917 if (ErasePolarity) {
918 FileState = (UINT8)~FileState;
919 }
920
921 HighestBit = 0x80;
922 while (HighestBit != 0 && (HighestBit & FileState) == 0) {
923 HighestBit >>= 1;
924 }
925
926 return HighestBit;
927}

Callers 1

PrintFileInfoFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected