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

Method AdjustBin

BaseTools/Source/C/VfrCompile/VfrCompiler.cpp:714–773  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

712}
713
714VOID
715CVfrCompiler::AdjustBin (
716 VOID
717 )
718{
719 EFI_VFR_RETURN_CODE Status;
720
721 if (!IS_RUN_STATUS(STATUS_COMPILEED)) {
722 return;
723 }
724
725 if (gNeedAdjustOpcode) {
726 //
727 // When parsing the Vfr, has created some opcodes, now need to update the record info.
728 //
729 gCIfrRecordInfoDB.IfrUpdateRecordInfoForDynamicOpcode (FALSE);
730 }
731
732 //
733 // Check whether need to check default info for question or auto add default for question.
734 //
735 if (mOptions.AutoDefault || mOptions.CheckDefault) {
736 gCIfrRecordInfoDB.IfrCheckAddDefaultRecord (mOptions.AutoDefault, mOptions.CheckDefault);
737 }
738
739 //
740 // Check Binary Code consistent between Form and IfrRecord
741 //
742
743 //
744 // Get Package Data and IfrRecord Data
745 //
746 gCFormPkg.BuildPkg (gCBuffer);
747 gCIfrRecordInfoDB.IfrRecordOutput (gRBuffer);
748
749 //
750 // Compare Form and Record data
751 //
752 if (gCBuffer.Buffer != NULL && gRBuffer.Buffer != NULL) {
753 UINT32 Index;
754 if (gCBuffer.Size != gRBuffer.Size) {
755 DebugError (NULL, 0, 0001, "Error parsing vfr file", " %s. FormBinary Size 0x%X is not same to RecordBuffer Size 0x%X", mOptions.VfrFileName, gCBuffer.Size, gRBuffer.Size);
756 }
757 for (Index = 0; Index < gCBuffer.Size; Index ++) {
758 if (gCBuffer.Buffer[Index] != gRBuffer.Buffer[Index]) {
759 break;
760 }
761 }
762 if (Index != gCBuffer.Size) {
763 DebugError (NULL, 0, 0001, "Error parsing vfr file", " %s. the 0x%X byte is different between Form and Record", mOptions.VfrFileName, Index);
764 }
765 DebugMsg (NULL, 0, 9, (CHAR8 *) "IFR Buffer", (CHAR8 *) "Form Buffer same to Record Buffer and Size is 0x%X", Index);
766 } else if (gCBuffer.Buffer == NULL && gRBuffer.Buffer == NULL) {
767 //ok
768 } else {
769 DebugError (NULL, 0, 0001, "Error parsing vfr file", " %s.Buffer not allocated.", mOptions.VfrFileName);
770 }
771

Callers 1

mainFunction · 0.80

Calls 5

DebugMsgFunction · 0.85
BuildPkgMethod · 0.80
IfrRecordOutputMethod · 0.80

Tested by

no test coverage detected